Package org.jboss.remoting

Examples of org.jboss.remoting.LeasePinger


     
      // 1. Kill LeasePinger for Client 1.
      ClientInvoker invoker = client1.getInvoker();
      Field field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(invoker);
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      timerTask.cancel();
      log.info("stopped LeasePinger");
View Full Code Here


     
      // 1. Kill LeasePinger.
      ClientInvoker invoker = client.getInvoker();
      Field field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(invoker);
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      timerTask.cancel();
      log.info("stopped LeasePinger");
View Full Code Here

      log.info("entering " + getName());
     
      setupServer();
      SocketClientInvoker clientInvoker = new SocketClientInvoker(serverLocator);
      clientInvoker.connect();
      LeasePinger leasePinger = new LeasePinger(clientInvoker, "abc", 2000);
      log.info("expect WARN \"failed to ping to server\"");
      Method method = LeasePinger.class.getDeclaredMethod("setLeasePingerId", new Class[]{String.class});
      method.setAccessible(true);
      method.invoke(leasePinger, new Object[]{"dummyID"});
      leasePinger.addClient("def", null, 1000);
     
      // Verify LeasePingerTimerTask has not been created.
      Field field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(leasePinger);
      assertNull(timerTask);
      leasePinger.startPing();
      timerTask = (TimerTask) field.get(leasePinger);
      assertNotNull(timerTask);
     
      // Verify new LeasePingerTimerTask gets created when adding new Client
      // with shorter lease period.
      leasePinger.addClient("ghi", null, 500);
      TimerTask newTimerTask = (TimerTask) field.get(leasePinger);
      assertNotSame(newTimerTask, timerTask);
     
      log.info(getName() + " PASSES");
   }
View Full Code Here

         client.addListener(callbackHandler, null, null, true);
      }
     
      field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(client.getInvoker());
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      timerTask.cancel();
     
View Full Code Here

      // Verify LeasePinger is running.
      assertTrue(client.getInvoker() instanceof MicroRemoteClientInvoker);
      ClientInvoker clientInvoker = client.getInvoker();
      Field field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(clientInvoker);
      assertNotNull(pinger);
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      assertNotNull(timerTask);
View Full Code Here

      // Verify LeasePinger is running.
      assertTrue(client.getInvoker() instanceof MicroRemoteClientInvoker);
      ClientInvoker clientInvoker = client.getInvoker();
      Field field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(clientInvoker);
      assertNotNull(pinger);
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      assertNotNull(timerTask);
View Full Code Here

      // Verify LeasePinger is running.
      assertTrue(client.getInvoker() instanceof MicroRemoteClientInvoker);
      ClientInvoker clientInvoker = client.getInvoker();
      Field field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(clientInvoker);
      assertNotNull(pinger);
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      assertNotNull(timerTask);
View Full Code Here

      // Verify LeasePinger is running.
      assertTrue(client.getInvoker() instanceof MicroRemoteClientInvoker);
      ClientInvoker clientInvoker = client.getInvoker();
      Field field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(clientInvoker);
      assertNotNull(pinger);
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      assertNotNull(timerTask);
View Full Code Here

      // Verify LeasePinger is running.
      assertTrue(client.getInvoker() instanceof MicroRemoteClientInvoker);
      ClientInvoker clientInvoker = client.getInvoker();
      Field field = MicroRemoteClientInvoker.class.getDeclaredField("leasePinger");
      field.setAccessible(true);
      LeasePinger pinger = (LeasePinger) field.get(clientInvoker);
      assertNotNull(pinger);
      field = LeasePinger.class.getDeclaredField("timerTask");
      field.setAccessible(true);
      TimerTask timerTask = (TimerTask) field.get(pinger);
      assertNotNull(timerTask);
View Full Code Here

TOP

Related Classes of org.jboss.remoting.LeasePinger

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.