Package org.springframework.remoting.support

Examples of org.springframework.remoting.support.RemoteInvocationResult


                if (invocation instanceof LingoInvocation) {
                    LingoInvocation lingoInvocation = (LingoInvocation) invocation;
                    oneway = lingoInvocation.getMetadata().isOneWay();
                    introduceRemoteReferences(lingoInvocation, message);
                }
                RemoteInvocationResult result = invokeAndCreateResult(invocation, this.proxy);
                if (!oneway) {
                    writeRemoteInvocationResult(message, result);
                }
            }
        }
View Full Code Here


                requestor.oneWay(destination, requestMessage);
                return null;
            }
            else {
                Message response = requestor.request(destination, requestMessage);
                RemoteInvocationResult result = marshaller.extractInvocationResult(response);
                return recreateRemoteInvocationResult(result);
            }
        }
        catch (JMSException ex) {
            throw new RemoteAccessException("Cannot access JMS invoker remote service at [" + getServiceUrl() + "]", ex);
View Full Code Here

                    DefaultRemoteInvocationExecutor executor = new DefaultRemoteInvocationExecutor();
                    Object result = executor.invoke((RemoteInvocation) rmi, person);

                    // Convert result to an rmi invocation
                    RemoteInvocationResult rmiResult = new RemoteInvocationResult(result);
                    out.setContent(new StringSource(xstream.toXML(rmiResult)));
                } catch (Exception e) {
                    throw new MessagingException(e);
                }
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

          TransactionMgr.abort();
        }
          if (!currentTransactions.empty()) {
            currentTransactions.get(0).currentInvoker = null;
          }
        return new RemoteInvocationResult(e.exception);
      }
      else if (result.getValue() instanceof RemoteInvocationResultWrapper) {
        RemoteInvocationResultWrapper wrapper = (RemoteInvocationResultWrapper)result.getValue();
        Boolean wasAborted = (Boolean)wrapper.getAttribute(WAS_ABORTED);
          LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
View Full Code Here

  public void handleRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    try {
      RemoteInvocation invocation = readRemoteInvocation(request);
      RemoteInvocationResult result = invokeAndCreateResult(invocation, getProxy());
      writeRemoteInvocationResult(request, response, result);
    }
    catch (ClassNotFoundException ex) {
      throw new NestedServletException("Class not found during deserialization", ex);
    }
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

          TransactionMgr.abort();
        }
          if (!currentTransactions.empty()) {
            currentTransactions.get(0).currentInvoker = null;
          }
        return new RemoteInvocationResult(e.exception);
      }
      else if (result.getValue() instanceof RemoteInvocationResultWrapper) {
        RemoteInvocationResultWrapper wrapper = (RemoteInvocationResultWrapper)result.getValue();
        Boolean wasAborted = (Boolean)wrapper.getAttribute(WAS_ABORTED);
          LightweightStack<TransactionData> currentTransactions = _transactionStorage.get();
View Full Code Here

            remoteInvocation.addAttribute(attributeProvider.getAttributeName(), attributeProvider.getAttributeValue(remoteInvocation, null));
        }

         TransactionMgr.beginRemoteCall(config, remoteInvocation);
       
        RemoteInvocationResult result = nestedHttpInvokerRequestExecutor.executeRequest(config, remoteInvocation);

        TransactionMgr.endRemoteCall(result);
       
        if (result.getValue() instanceof RemoteInvocationResultWrapper) {
            RemoteInvocationResultWrapper resultWrapper = (RemoteInvocationResultWrapper)result.getValue();

            // Attribute Consumers
            for (RemoteInvocationAttributeConsumer attributeConsumer : getRemoteInvocationAttributeConsumers()) {
                attributeConsumer.consume(remoteInvocation.getArguments(), resultWrapper.getAttribute(attributeConsumer.getAttributeName()));
            }
            return new RemoteInvocationResult(resultWrapper.getReturnValue());
        }
        return result;
    }
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.