Package org.jboss.remoting

Examples of org.jboss.remoting.Client.invokeOneway()


      assertEquals(1, invocationHandler.callbackHandlers.size());
      log.info("client added callback handler");
     
      client.invokeOneway(CALLBACK_TEST);
      client.invokeOneway(CALLBACK_TEST);
      client.invokeOneway(CALLBACK_TEST);
      Thread.sleep(500);
      assertEquals(3, callbackHandler.callbackCounter);
     
      Iterator it = invocationHandler.callbackHandlers.iterator();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) it.next();


      client.addListener(callbackHandler, new InvokerLocator(callbackLocatorURI1));
      client.addListener(callbackHandler, new InvokerLocator(callbackLocatorURI2));
      assertEquals(2, invocationHandler.callbackHandlers.size());
      log.info("client added callback handlers");
     
      client.invokeOneway(CALLBACK_TEST);
      client.invokeOneway(CALLBACK_TEST);
      Thread.sleep(500);
      assertEquals(2, callbackHandler.callbackCounter);
     
      Iterator it = invocationHandler.callbackHandlers.iterator();

      client.addListener(callbackHandler, new InvokerLocator(callbackLocatorURI2));
      assertEquals(2, invocationHandler.callbackHandlers.size());
      log.info("client added callback handlers");
     
      client.invokeOneway(CALLBACK_TEST);
      client.invokeOneway(CALLBACK_TEST);
      Thread.sleep(500);
      assertEquals(2, callbackHandler.callbackCounter);
     
      Iterator it = invocationHandler.callbackHandlers.iterator();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler1 = (ServerInvokerCallbackHandler) it.next();

         MessageAbstraction resMessage = null;

         if (oneway == true)
         {
            client.invokeOneway(reqMessage, metadata, false);
         }
         else
         {
            resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
         }

         MessageAbstraction resMessage = null;

         if (oneway == true)
         {
            client.invokeOneway(reqMessage, metadata, false);
         }
         else
         {
            resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
         }

        MessageAbstraction resMessage = null;

        if (oneway == true)
        {
          client.invokeOneway(reqMessage, metadata, false);
        }
        else
        {
          resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
        }

         MessageAbstraction resMessage = null;

         if (oneway == true)
         {
            client.invokeOneway(reqMessage, metadata, false);
         }
         else
         {
            resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
         }

            MessageAbstraction resMessage = null;

            if (oneway == true)
            {
               client.invokeOneway(reqMessage, metadata, false);
            }
            else
            {
               resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
            }

       * has been placed into a worker thread pool on the server.  This ensures that
       * the call at least made it to the server.
       */
      String payload1 = "Oneway call 1.";
      System.out.println("Making oneway invocation with payload of '" + payload1 + "'");
      remotingClient.invokeOneway(payload1);

      /**
       * This call is the same as the one above, except the last parameter will
       * place the invocation request into a worker thread pool on the client and
       * return immediately.  The worker thread will then make the invocation

       * on the remoting server (which means caller will not be aware if was a
       * problem making the actual invocation on the server).
       */
      String payload2 = "Oneway call 2.";
      System.out.println("Making oneway invocation with payload of '" + payload2 + "'");
      remotingClient.invokeOneway(payload2, null, true);
   }

   /**
    * Can pass transport and port to be used as parameters.
    * Valid transports are 'rmi' and 'socket'.

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.