Package org.springframework.remoting.support

Examples of org.springframework.remoting.support.RemoteInvocation


            {
                throw new TransformerException(this, e);
            }
        }

        RemoteInvocation ri = (RemoteInvocation) o;
        if (logger.isDebugEnabled())
        {
            logger.debug("request to execute " + ri.getMethodName());
            for (int i = 0; i < ri.getArguments().length; i++)
            {
                Object currentArgument = ri.getArguments()[i];
               
                StringBuilder buf = new StringBuilder(64);
                buf.append("with argument (");
                buf.append(currentArgument == null ? "<null>" : currentArgument.toString());
                buf.append(")");
View Full Code Here


        Object[] args = {"localhost"};
        expect(mi.getArguments()).andReturn(args).anyTimes();

        replay(mi);

        RemoteInvocation ri = factory.createRemoteInvocation(mi);

        verify(mi);

        assertNull(ri.getAttribute(SecureRemoteInvocationFactory.SESSION_ID_KEY));
    }
View Full Code Here

        Object[] args = {sessionKey};
        expect(mi.getArguments()).andReturn(args).anyTimes();

        replay(mi);

        RemoteInvocation ri = factory.createRemoteInvocation(mi);

        verify(mi);

        assertEquals(dummySessionId, ri.getAttribute(SecureRemoteInvocationFactory.SESSION_ID_KEY));
    }
View Full Code Here

                log.trace("No 'shiro.session.id' system property found.  Heuristics have been exhausted; " +
                        "RemoteInvocation will not contain a sessionId.");
            }
        }

        RemoteInvocation ri = new RemoteInvocation(mi);
        if (sessionId != null) {
            ri.addAttribute(SESSION_ID_KEY, sessionId);
        }
        if (host != null) {
            ri.addAttribute(HOST_KEY, host);
        }

        return ri;
    }
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

   */
  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

            }
            else
                invocationArgs[i] = args[i];
        }

        RemoteInvocation remoteInvocation = new RemoteInvocation(methodInvocation.getMethod().getName(),
                methodInvocation.getMethod().getParameterTypes(), invocationArgs);



        Map<String, Object> appContext = FrameworkUtils.getAppContextValues();
        if (appContext != null && appContext.values().size() > 0) {
            remoteInvocation.setAttributes(appContext);
        }
        return remoteInvocation;
    }
View Full Code Here

     * Creates remote invocation and adds the objects in the current app context
     * to the invocation.
     * @see org.springframework.remoting.support.RemoteInvocationFactory#createRemoteInvocation(org.aopalliance.intercept.MethodInvocation)
     */
    public RemoteInvocation createRemoteInvocation(MethodInvocation pMethod) {
        RemoteInvocation invocation = new CompressedRemoteInvocation(pMethod);

        Map<String, Object> appContext = FrameworkUtils.getAppContextValues();
        if (appContext != null && appContext.values().size() > 0) {
            invocation.setAttributes(appContext);
        }
        return invocation;
    }
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;
    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.