Package org.jboss.remoting

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


      int i = 0;
      try
      {
         for (; i < MAX_POOL_SIZE + 10; i++)
         {
            client.invokeOneway(new Integer(i), null, false);
            log.debug("invocation: " + i);
         }
      }
      catch (Throwable t)
      {


      int i = 0;
      try
      {
         for (; i < MAX_POOL_SIZE + 10; i++)
         {
            client.invokeOneway(new Integer(i), null, true);
            log.debug("invocation: " + i);
         }
      }
      catch (Throwable t)
      {

      DelayedCallbackHandler callbackHandler = new DelayedCallbackHandler();
      client.addListener(callbackHandler, new InvokerLocator(callbackLocatorURI));
      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);
     

      client.addListener(callbackHandler, new InvokerLocator(callbackLocatorURI));
      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();

      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();

      {
         InvokerLocator locator = new InvokerLocator(getLocator());
         Client client = new Client(locator);
         client.connect();

         client.invokeOneway("cheese");

         Thread.currentThread().sleep(8000);

         client.invokeOneway("poofs");

         client.invokeOneway("cheese");

         Thread.currentThread().sleep(8000);

         client.invokeOneway("poofs");

         Thread.currentThread().sleep(5000);

         Object ret = client.invoke("crackers");

         checkUserAgent(remotingClient, metadata);

         makeExceptionInvocation(remotingClient, metadata);

         remotingClient.invokeOneway("Do something", metadata, true);

         remotingClient.invokeOneway("Do something", metadata, false);
      }
      catch (Throwable throwable)
      {

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.