Package org.jboss.remoting

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


      Thread.sleep(2 * pingFrequency);
      Long lastPing = (Long) field.get(t);
      log.info("current: " + System.currentTimeMillis() + ", lastPing: " + lastPing);
      assertTrue((System.currentTimeMillis() - lastPing.longValue()) < pingFrequency);
     
      client.removeListener(callbackHandler);
      client.disconnect();
   }
  
  
   public void testControlConnectionFailureServerSide() throws Throwable
View Full Code Here


      Thread.sleep(TEST_PING_FREQUENCY * MAX_INITIAL_ATTEMPTS);
      client.invoke(CALLBACK_TEST);
      // Callback should be possible because control connection has been replaced.
      assertEquals(1, callbackHandler.callbackCounter);
     
      client.removeListener(callbackHandler);
      client.disconnect();
   }
  
  
   public void testNoControlConnectionRestart() throws Throwable
View Full Code Here

      log.info("client added callback handler");
     
      client.invoke(CALLBACK_TEST);
      assertEquals(2, callbackHandler.callbackCounter);

      client.removeListener(callbackHandler);
      client.disconnect();
     
      // The ControlMonitorTimerTask from the first callback handler tries to recreate
      // its control connection, which adds an entry to
      // BisocketClientInvoker.listenerIdToSocketsMap which cannot be removed, which
View Full Code Here

         assertNotNull(field.get(serverInvokers[j]));
      }
     
      for (int j = 0; j < CALLBACK_HANDLER_COUNT; j++)
      {
         client.removeListener(callbackHandlers[j]);
      }
     
      assertEquals(0, listenerIdToServerInvokerMap.size());
      assertEquals(0, listenerIdToClientInvokerMap.size());
      assertEquals(0, listenerIdToCallbackClientInvokerMap.size());
View Full Code Here

     
      client.setDisconnectTimeout(0);
     
      for (int j = 0; j < CALLBACK_HANDLER_COUNT; j++)
      {
         client.removeListener(callbackHandlers[j]);
      }
     
      assertEquals(0, listenerIdToServerInvokerMap.size());
      assertEquals(0, listenerIdToClientInvokerMap.size());
     
View Full Code Here

         metadata.put(COUNTER, count);
         Object response = client.invoke(INVOCATION_TEST, metadata);
         assertTrue(response.equals(count));
      }
     
      client.removeListener(callbackHandler);
      client.disconnect();
   }
  
  
   public void testAlternatingInvocationsAndCallbacks() throws Throwable
View Full Code Here

         client.invoke(CALLBACK_TEST);
         assertTrue(response.equals(count));
      }
     
      assertEquals(invocationCount, callbackHandler.callbackCounter);
      client.removeListener(callbackHandler);
      client.disconnect();
   }
  
  
   public void testPullCallbacks() throws Throwable
View Full Code Here

      Field field = BisocketClientInvoker.class.getDeclaredField("listenerIdToClientInvokerMap");
      field.setAccessible(true);
      Map listenerIdToClientInvokerMap = (Map) field.get(client.getInvoker());
      assertEquals(0, listenerIdToClientInvokerMap.size());
     
      client.removeListener(callbackHandler);
      client.disconnect();
   }
  
  
   public void testMaxSocketPoolSize() throws Throwable
View Full Code Here

         {
            System.out.println("callback failed");
            throw new Exception("callback failed");
         }
         System.out.println("callback successful");
         client.removeListener(callbackHandler);
         client.disconnect();
         Thread t = new Thread()
         {
            public void run()
            {
View Full Code Here

      {
         client.invoke("test");
      }
      long finish = System.currentTimeMillis();
      System.out.println("time to make " + invocations + " invocations: " + (finish - start));
      client.removeListener(callbackHandler);
      client.disconnect();
   }
  
  
   /**
 
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.