Package org.springframework.remoting.support

Examples of org.springframework.remoting.support.RemoteInvocation


        // copied from superclass
        if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
            return "RMI invoker proxy for service URL [" + getServiceUrl() + "]";
        }
        RemoteInvocation remoteInvocation = createRemoteInvocation(methodInvocation);

        // Attribute Provides
        for (RemoteInvocationAttributeProvider attributeProvider : getRemoteInvocationAttributeProviders()) {               //JVM 1.5
            remoteInvocation.addAttribute(attributeProvider.getAttributeName(), attributeProvider.getAttributeValue(remoteInvocation, null));
        }

        Object result = invocationHandler.invoke(remoteInvocation);

        if (result instanceof RemoteInvocationResultWrapper) {
            RemoteInvocationResultWrapper resultWrapper = (RemoteInvocationResultWrapper)result;

            // Attribute Consumers
            for (RemoteInvocationAttributeConsumer attributeConsumer : getRemoteInvocationAttributeConsumers()) {               //JVM 1.5
                attributeConsumer.consume(remoteInvocation.getArguments(), resultWrapper.getAttribute(attributeConsumer.getAttributeName()));
            }
            return resultWrapper.getReturnValue();
        }
        return result;
    }
View Full Code Here


          for (Object invokerObject : transactionData.distributedInvokers) {
            if (invokerObject instanceof HttpInvokerClientConfiguration) {
             
              HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
              HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
              RemoteInvocation call = new RemoteInvocation(action, new Class<?>[0], new Object[0]);
              call.addAttribute(TXN_ID, transactionData.distributedTransactionID);
              try {
                nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
              }
              catch (Exception e) {
                _log.error("Completing distributed transaction failed", e);
View Full Code Here

            // to re-tell it to abort the transaction
            if (invokerObject != rootData.currentInvoker) {
              if (invokerObject instanceof HttpInvokerClientConfiguration) {
                HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
                HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
                RemoteInvocation call = new RemoteInvocation(ABORT_TXN, new Class<?>[0], new Object[0]);
                  call.addAttribute(TXN_ID, rootData.distributedTransactionID);
                try {
                  nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
                }
                catch (Exception e) {
                  _log.error("Aborting distributed transaction failed", e);
View Full Code Here

        // copied from superclass
        if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
            return "RMI invoker proxy for service URL [" + getServiceUrl() + "]";
        }
        RemoteInvocation remoteInvocation = createRemoteInvocation(methodInvocation);

        // Attribute Provides
        for (RemoteInvocationAttributeProvider attributeProvider : getRemoteInvocationAttributeProviders()) {                  //JVM 1.5
            remoteInvocation.addAttribute(attributeProvider.getAttributeName(), attributeProvider.getAttributeValue(remoteInvocation, null));
        }

        Object result = invocationHandler.invoke(remoteInvocation);

        if (result instanceof RemoteInvocationResultWrapper) {
            RemoteInvocationResultWrapper resultWrapper = (RemoteInvocationResultWrapper)result;

            // Attribute Consumers
            for (RemoteInvocationAttributeConsumer attributeConsumer : getRemoteInvocationAttributeConsumers()) {                  //JVM 1.5
                attributeConsumer.consume(remoteInvocation.getArguments(), resultWrapper.getAttribute(attributeConsumer.getAttributeName()));
            }
            return resultWrapper.getReturnValue();
        }
        return result;
    }
View Full Code Here

    this.proxy = getProxyForService();
  }


  public void onMessage(Message requestMessage, Session session) throws JMSException {
    RemoteInvocation invocation = readRemoteInvocation(requestMessage);
    if (invocation != null) {
      RemoteInvocationResult result = invokeAndCreateResult(invocation, this.proxy);
      writeRemoteInvocationResult(requestMessage, session, result);
    }
  }
View Full Code Here

  public Object invoke(MethodInvocation methodInvocation) throws Throwable {
    if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
      return "JMS invoker proxy for queue [" + this.queue + "]";
    }

    RemoteInvocation invocation = createRemoteInvocation(methodInvocation);
    RemoteInvocationResult result = null;
    try {
      result = executeRequest(invocation);
    }
    catch (JMSException ex) {
View Full Code Here

      throws ServletException, IOException {

    Assert.notNull(this.proxy, "HttpInvokerServiceExporter has not been initialized");

    try {
      RemoteInvocation invocation = readRemoteInvocation(request);
      RemoteInvocationResult result = invokeAndCreateResult(invocation, this.proxy);
      writeRemoteInvocationResult(request, response, result);
    }
    catch (ClassNotFoundException ex) {
      throw new NestedServletException("Class not found during deserialization", ex);
View Full Code Here

  public Object invoke(MethodInvocation methodInvocation) throws Throwable {
    if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
      return "HTTP invoker proxy for service URL [" + getServiceUrl() + "]";
    }

    RemoteInvocation invocation = createRemoteInvocation(methodInvocation);
    RemoteInvocationResult result = null;
    try {
      result = executeRequest(invocation);
    }
    catch (Throwable ex) {
View Full Code Here

    this.proxy = getProxyForService();
  }


  public void onMessage(Message requestMessage, Session session) throws JMSException {
    RemoteInvocation invocation = readRemoteInvocation(requestMessage);
    if (invocation != null) {
      RemoteInvocationResult result = invokeAndCreateResult(invocation, this.proxy);
      writeRemoteInvocationResult(requestMessage, session, result);
    }
  }
View Full Code Here

  public Object invoke(MethodInvocation methodInvocation) throws Throwable {
    if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
      return "JMS invoker proxy for queue [" + this.queue + "]";
    }

    RemoteInvocation invocation = createRemoteInvocation(methodInvocation);
    RemoteInvocationResult result = null;
    try {
      result = executeRequest(invocation);
    }
    catch (JMSException ex) {
View Full Code Here

TOP

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

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.