Package org.jboss.remoting.invocation

Examples of org.jboss.remoting.invocation.NameBasedInvocation


   }

   protected Object makeClientInvocation(String method, String param) throws Throwable
   {
      Object ret = client.invoke(new NameBasedInvocation(method,
                                                         new Object[]{param},
                                                         new String[]{String.class.getName()}),
                                 null);

      return ret;
View Full Code Here


   }


   protected Object makeInvocation(String method, String param) throws Throwable
   {
      Object ret = client.invoke(new NameBasedInvocation(method,
                                                         new Object[]{param},
                                                         new String[]{String.class.getName()}),
                                 null);

      return ret;
View Full Code Here

      connectMethod.invoke(clientInstance, null);

      // simple invoke, should return bar
      Object ret = null;

      NameBasedInvocation nbinv = new NameBasedInvocation("testComplexReturn",
                                                          new Object[]{null},
                                                          new String[]{String.class.getName()});

      Method invokeMethod = clientClz.getMethod("invoke", new Class[]{Object.class, Map.class});
      ret = invokeMethod.invoke(clientInstance, new Object[]{nbinv, null});


      ComplexReturn complexRet = (ComplexReturn) ret;
      MockTest[] mockTests = complexRet.getMockTests();
      assertTrue("ComplexReturn's array should contain 2 items",
                 2 == mockTests.length);
      if(2 == mockTests.length)
      {
         log.debug("PASS");
      }
      else
      {
         log.debug("FAILED - testArrayReturn1");
      }

      for(int x = 0; x < mockTests.length; x++)
      {
         System.err.println(mockTests[x]);
         MockTest test = mockTests[x];
         assertNotNull("MockTest should not be null", test);
         if(test != null)
         {
            log.debug("PASS");
         }
         else
         {
            log.debug("FAILED - testArrayReturn2");
         }

      }

      nbinv = new NameBasedInvocation("testThrowException",
                                      new Object[]{null},
                                      new String[]{String.class.getName()});

      invokeMethod = clientClz.getMethod("invoke", new Class[]{Object.class, Map.class});
      try
View Full Code Here

      Object[] params = null;
      String[] sig = null;

      if(param instanceof NameBasedInvocation)
      {
         NameBasedInvocation nbi = (NameBasedInvocation) param;
         methodName = nbi.getMethodName();
         params = nbi.getParameters();
         sig = nbi.getSignature();
      }
      else if(param instanceof InternalInvocation)
      {
         InternalInvocation ii = (InternalInvocation) param;
         methodName = ii.getMethodName();
         params = ii.getParameters();
      }
      else
      {
         log.info("Don't recognize the parameter type, so just returning it.");
         return param;
      }

      String sessionId = invocation.getSessionId();
      String subsystem = invocation.getSubsystem();

      log.debug("invoke() called with method: " + methodName +
                "\tsessionId: " + sessionId + "\tsubsystem:" + subsystem);
      //deprecated since specific to JMX (old way of handling callbacks)
      if(methodName.equals("testComplexReturn"))
      {
         //Need to send back complex object containing array of complext objects.
         ComplexReturn ret = new ComplexReturn();
         return ret;
      }
      if(methodName.equals("testMarshalledObject"))
      {
         ComplexReturn ret = new ComplexReturn();
         MarshalledObject mObj = new MarshalledObject(ret);
         return mObj;
      }
      else if(methodName.equals("test"))
      {
         // will cause a callback on all the listeners
         log.debug("test called on server invocation handler, so should do callback.");
         CallbackDispatcher callbackDispatcher = new CallbackDispatcher(invocation.getSessionId(),
                                                                        invocation.getSubsystem(),
                                                                        new NameBasedInvocation("handleCallback",
                                                                                                params,
                                                                                                sig));
         Thread callbackThread = new Thread(callbackDispatcher);
         callbackThread.start();
      }
View Full Code Here

   {
   }

   private Object makeInvocation(String method, String param) throws Throwable
   {
      Object ret = client.invoke(new NameBasedInvocation(method,
                                                         new Object[]{param},
                                                         new String[]{String.class.getName()}),
                                 null);

      return ret;
View Full Code Here

      return transport;
   }
  
   protected Object makeInvocation(String method, String param) throws Throwable
   {
      Object ret = client.invoke(new NameBasedInvocation(method,
            new Object[]{param},
            new String[]{String.class.getName()}),
            null);
     
      return ret;
View Full Code Here

      return ret;
   }
  
   protected Object solicitCallback(String param) throws Throwable
   {
      Object ret = client.invoke(new NameBasedInvocation("test",
            new Object[]{param},
            new String[]{String.class.getName()}),
            null);
     
      return ret;
View Full Code Here

   {
   }

   public Object invoke(InvocationRequest invocation) throws Throwable
   {
      NameBasedInvocation nbi = (NameBasedInvocation)invocation.getParameter();

      String methodName = nbi.getMethodName();

      if ("ping".equals(methodName))
      {
         return "pong." + nbi.getParameters()[0];
      }

      return null;
   }
View Full Code Here

   public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
   {
      String methodName = method.getName();
      String[] paramSig = createParamSignature(method.getParameterTypes());

      NameBasedInvocation request = new NameBasedInvocation(methodName,
                                                            args,
                                                            paramSig);
      Object response = null;

      boolean failOver = false;
View Full Code Here

      return client;
   }

   protected Object makeInvocation(String method, String param) throws Throwable
   {
      return client.invoke(new NameBasedInvocation(method,
                                                   new Object[]{param},
                                                   new String[]{String.class.getName()}),
                           null);
   }
View Full Code Here

TOP

Related Classes of org.jboss.remoting.invocation.NameBasedInvocation

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.