Examples of MethodInvocation


Examples of org.gradle.messaging.dispatch.MethodInvocation

            one(target).dispatch(new RemoteMethodInvocation(0, new Object[]{12}));
            inSequence(sequence);
        }});

        dispatch.dispatch(new MethodInvocation(method, new Object[]{17}));
        dispatch.dispatch(new MethodInvocation(method, new Object[]{12}));
    }
View Full Code Here

Examples of org.gradle.messaging.dispatch.MethodInvocation

    @Test
    public void transformsRemoteMethodInvocationMessage() throws Exception {
        final Method method = String.class.getMethod("charAt", Integer.TYPE);

        context.checking(new Expectations() {{
            one(target).dispatch(new MethodInvocation(method, new Object[]{17}));
        }});

        dispatch.dispatch(new MethodMetaInfo(1, method));
        dispatch.dispatch(new RemoteMethodInvocation(1, new Object[]{17}));
    }
View Full Code Here

Examples of org.gradle.messaging.dispatch.MethodInvocation

    @Test
    public void deliversMethodInvocationsOnOutgoingObjectToHandlerDispatch() throws Exception {
        final Dispatch<MethodInvocation> handler = context.mock(Dispatch.class);
        context.checking(new Expectations() {{
            one(handler).dispatch(new MethodInvocation(TestRemote.class.getMethod("doStuff", String.class),
                    new Object[]{"param"}));
        }});
        receiver.addIncoming(TestRemote.class, handler);

        TestRemote proxy = sender.addOutgoing(TestRemote.class);
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

      }

      // the method handles both the case of a first connection creation attempt and a retry during
      // a client-side failover. The difference is given by the failedNodeID (-1 for first attempt)

      MethodInvocation mi = (MethodInvocation)invocation;
      String username = (String)mi.getArguments()[0];
      String password = (String)mi.getArguments()[1];
      Integer failedNodeID = (Integer)mi.getArguments()[2];

      // We attempt to connect to the next node in a loop, since we might need to go through
      // multiple hops

      int attemptCount = 0;
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   // Public ---------------------------------------------------------------------------------------

   public Object handleSend(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
     
      Object[] args = mi.getArguments();
     
      Destination destination = (Destination)args[0];
      Message m = (Message)args[1];
      int deliveryMode = ((Integer)args[2]).intValue();
      int priority = ((Integer)args[3]).intValue();
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

   // Public ---------------------------------------------------------------------------------------

   public Object handleCreateConsumerDelegate(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;

      ConsumerDelegate consumerDelegate = (ConsumerDelegate)invocation.invokeNext();

      boolean isCC = ((Boolean)mi.getArguments()[4]).booleanValue();

      // Create the message handler
      SessionState sessionState =
         (SessionState)((DelegateSupport)invocation.getTargetObject()).getState();
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

      return l;
   }     
  
   public Object handleReceive(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
      Object[] args = mi.getArguments();
      long timeout = args == null ? 0 : ((Long)args[0]).longValue();
     
      return getMessageCallbackHandler(invocation).receive(timeout);
   }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

      return getMessageCallbackHandler(invocation).receive(-1);
   }
  
   public Object handleSetMessageListener(Invocation invocation) throws Throwable
   {  
      MethodInvocation mi = (MethodInvocation)invocation;
      Object[] args = mi.getArguments();
      MessageListener l = (MessageListener)args[0];
     
      getMessageCallbackHandler(invocation).setMessageListener(l);
     
      return null;
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

         {
            log.trace("invoking non-method invocation: " + invocation);
         }
         else
         {
            MethodInvocation mi = (MethodInvocation)invocation;
            method = mi.getMethod();
            methodName = method.getName();
            StringBuffer sb = new StringBuffer();
            sb.append("invoking ").append(target).append('.').append(methodName).append('(');
            Object[] args = mi.getArguments();
            if (args != null)
            {
               for(int i = 0; i < args.length; i++)
               {
                  // special precaution to hide passwords
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

      if (!currentState.isJustCreated())
      {
         throw new IllegalStateException("setClientID can only be called directly after the connection is created");
      }
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      currentState.setClientID((String)mi.getArguments()[0]);
     
      currentState.setJustCreated(false);
     
      // this gets invoked on the server too
      return invocation.invokeNext();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.