Package org.springframework.remoting.support

Examples of org.springframework.remoting.support.RemoteInvocationResult


        super();
    }

    @Override
    protected void processNormalExit(Operation op, Object returnValue) {
        RemoteInvocationResult result = (RemoteInvocationResult) returnValue;
        Throwable remoteError = result.getException();
        if (remoteError != null) {
            op.put(REMOTE_EXCEPTION, StringFormatterUtils.formatStackTrace(remoteError));
        } else {
            op.put(OperationFields.RETURN_VALUE, StringFormatterUtils.formatObject(result.getValue()));
        }
    }
View Full Code Here


            if (logger.isDebugEnabled())
            {
                logger.debug("ObjectToRemoteInvocationResult.doTransform(" + src + ")");
            }

            RemoteInvocationResult rval;

            if (src instanceof RemoteInvocationResult)
            {
                rval = (RemoteInvocationResult)src;
            }
            else
            {
                rval = new RemoteInvocationResult(src);
            }

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(baos);
            oos.writeObject(rval);
View Full Code Here

                Object value = invoke(invocation, proxy);
                return value;
            }
            catch (Throwable ex)
            {
                return new RemoteInvocationResult(ex);
            }
        }
View Full Code Here

    if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
      return "HTTP invoker proxy for service URL [" + getServiceUrl() + "]";
    }

    RemoteInvocation invocation = createRemoteInvocation(methodInvocation);
    RemoteInvocationResult result;
    try {
      result = executeRequest(invocation, methodInvocation);
    }
    catch (Throwable ex) {
      throw convertHttpInvokerAccessException(ex);
    }
    try {
      return recreateRemoteInvocationResult(result);
    }
    catch (Throwable ex) {
      if (result.hasInvocationTargetException()) {
        throw ex;
      }
      else {
        throw new RemoteInvocationFailureException("Invocation of method [" + methodInvocation.getMethod() +
            "] failed in HTTP invoker remote service at [" + getServiceUrl() + "]", ex);
View Full Code Here

   */
  @Override
  public void handle(HttpExchange exchange) throws IOException {
    try {
      RemoteInvocation invocation = readRemoteInvocation(exchange);
      RemoteInvocationResult result = invokeAndCreateResult(invocation, getProxy());
      writeRemoteInvocationResult(exchange, result);
      exchange.close();
    }
    catch (ClassNotFoundException ex) {
      exchange.sendResponseHeaders(500, -1);
View Full Code Here

      factory.setServiceUrl("/svc/dummy");
      factory.setServiceInterface(MyService.class);
      factory.setHttpInvokerRequestExecutor(new HttpInvokerRequestExecutor() {
        @Override
        public RemoteInvocationResult executeRequest(HttpInvokerClientConfiguration config, RemoteInvocation invocation) {
          return new RemoteInvocationResult(null);
        }
      });
      return factory;
    }
View Full Code Here

      factory.setServiceUrl("/svc/" + name);
      factory.setServiceInterface(MyService.class);
      factory.setHttpInvokerRequestExecutor(new HttpInvokerRequestExecutor() {
        @Override
        public RemoteInvocationResult executeRequest(HttpInvokerClientConfiguration config, RemoteInvocation invocation) {
          return new RemoteInvocationResult(null);
        }
      });
      return factory;
    }
View Full Code Here

    if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
      return "JMS invoker proxy for queue [" + this.queue + "]";
    }

    RemoteInvocation invocation = createRemoteInvocation(methodInvocation);
    RemoteInvocationResult result;
    try {
      result = executeRequest(invocation);
    }
    catch (JMSException ex) {
      throw convertJmsInvokerAccessException(ex);
    }
    try {
      return recreateRemoteInvocationResult(result);
    }
    catch (Throwable ex) {
      if (result.hasInvocationTargetException()) {
        throw ex;
      }
      else {
        throw new RemoteInvocationFailureException("Invocation of method [" + methodInvocation.getMethod() +
            "] failed in JMS invoker remote service at queue [" + this.queue + "]", ex);
View Full Code Here

   * @see #writeRemoteInvocationResult(com.sun.net.httpserver.HttpExchange, org.springframework.remoting.support.RemoteInvocationResult)
   */
  public void handle(HttpExchange exchange) throws IOException {
    try {
      RemoteInvocation invocation = readRemoteInvocation(exchange);
      RemoteInvocationResult result = invokeAndCreateResult(invocation, getProxy());
      writeRemoteInvocationResult(exchange, result);
      exchange.close();
    }
    catch (ClassNotFoundException ex) {
      exchange.sendResponseHeaders(500, -1);
View Full Code Here

    if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
      return "HTTP invoker proxy for service URL [" + getServiceUrl() + "]";
    }

    RemoteInvocation invocation = createRemoteInvocation(methodInvocation);
    RemoteInvocationResult result = null;
    try {
      result = executeRequest(invocation, methodInvocation);
    }
    catch (Throwable ex) {
      throw convertHttpInvokerAccessException(ex);
    }
    try {
      return recreateRemoteInvocationResult(result);
    }
    catch (Throwable ex) {
      if (result.hasInvocationTargetException()) {
        throw ex;
      }
      else {
        throw new RemoteInvocationFailureException("Invocation of method [" + methodInvocation.getMethod() +
            "] failed in HTTP invoker remote service at [" + getServiceUrl() + "]", ex);
View Full Code Here

TOP

Related Classes of org.springframework.remoting.support.RemoteInvocationResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.