Package org.jboss.remoting

Examples of org.jboss.remoting.ServerInvoker$InvalidStateException


/* 105 */         if (log.isTraceEnabled())
/*     */         {
/* 107 */           log.trace("Error calling on " + this.serverInvoker + " because is in invalid state.  Will retry with new server invoker.");
/*     */         }
/*     */
/* 110 */         ServerInvoker newServerInvoker = null;
/*     */
/* 113 */         ServerInvoker[] invokers = InvokerRegistry.getServerInvokers();
/* 114 */         if (invokers != null)
/*     */         {
/* 116 */           for (int x = 0; x < invokers.length; x++)
/*     */           {
/* 118 */             ServerInvoker svrinvoker = invokers[x];
/* 119 */             InvokerLocator svrlocator = svrinvoker.getLocator();
/* 120 */             if (!getLocator().equals(svrlocator))
/*     */               continue;
/* 122 */             newServerInvoker = svrinvoker;
/* 123 */             break;
/*     */           }
View Full Code Here


/* 185 */     ServerInvoker[] serverInvokers = InvokerRegistry.getServerInvokers();
/* 186 */     if ((serverInvokers != null) && (serverInvokers.length > 0))
/*     */     {
/* 188 */       for (int x = 0; x < serverInvokers.length; x++)
/*     */       {
/* 190 */         ServerInvoker svrInvoker = serverInvokers[x];
/* 191 */         InvokerLocator locator = svrInvoker.getLocator();
/* 192 */         if (locatorUrl.equalsIgnoreCase(locator.getOriginalURI()))
/*     */         {
/* 194 */           return (ServletServerInvokerMBean)svrInvoker;
/*     */         }
/*     */       }
View Full Code Here

      client.addListener(callbackHandler, new HashMap());
      log.info("client added callback handler");
      client.invoke(CALLBACK_TEST);
      assertEquals(1, callbackHandler.callbackCounter);
     
      ServerInvoker serverInvoker = connector.getServerInvoker();
      assertTrue(serverInvoker instanceof BisocketServerInvoker);
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
      Map callbackHandlers = (Map) field.get(serverInvoker);
      assertEquals(1, callbackHandlers.size());
View Full Code Here

      Map callbackConnectors = (Map) field.get(client);
      assertEquals(1, callbackConnectors.size());
      Set callbackConnectorSet = (Set) callbackConnectors.values().iterator().next();
      assertEquals(1, callbackConnectorSet.size());
      Connector callbackConnector = (Connector) callbackConnectorSet.iterator().next();
      ServerInvoker cbsi = callbackConnector.getServerInvoker();
      assertTrue(cbsi instanceof BisocketServerInvoker);
      field = BisocketServerInvoker.class.getDeclaredField("controlConnectionThreadMap");
      field.setAccessible(true);
      Map controlConnectionThreadMap = (Map) field.get(cbsi);
      assertEquals(1, controlConnectionThreadMap.size());
      Thread t = (Thread) controlConnectionThreadMap.values().iterator().next();
      Class[] classes = BisocketServerInvoker.class.getDeclaredClasses();
      Class controlConnectionThreadClass = null;
     
      for (int i = 0; i < classes.length; i++)
      {
         log.info(classes[i]);
         String fqn = classes[i].getName();
         String className = fqn.substring(fqn.lastIndexOf('.') + 1);
         log.info(className);
         if ("BisocketServerInvoker$ControlConnectionThread".equals(className))
         {
            controlConnectionThreadClass = classes[i];
            break;
         }
      }
     
      assertNotNull(controlConnectionThreadClass);
      assertEquals(t.getClass(), controlConnectionThreadClass);
      field = controlConnectionThreadClass.getDeclaredField("controlSocket");
      field.setAccessible(true);
      Socket controlSocket = (Socket) field.get(t);
      assertNotNull(controlSocket);
      controlSocket.close();
      log.info("CLOSED CONTROL SOCKET");
     
      // Shut down the only existing ServerThread on the server side, and therefore
      // the only existing pooled connection on the client side, forcing the
      // next invocation to depend on the creation of a new control connection.
      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      ServerInvoker serverInvoker = connector.getServerInvoker();
      assertTrue(serverInvoker instanceof BisocketServerInvoker);
      LRUPool clientpool = (LRUPool) field.get(serverInvoker);
      Set serverThreads = clientpool.getContents();
      assertEquals(1, serverThreads.size());
      ((ServerThread)serverThreads.iterator().next()).shutdown();
View Full Code Here

      log.info("RESTARTED CONNECTOR");
     
      // Wait until a failure has been detected on the control connection.
      Thread.sleep(TEST_PING_FREQUENCY * MAX_RETRIES * 8);
     
      ServerInvoker callbackServerInvoker = callbackConnector.getServerInvoker();
      field = BisocketServerInvoker.class.getDeclaredField("controlConnectionThreadMap");
      field.setAccessible(true);
      Map controlConnectionThreadMap = (Map) field.get(callbackServerInvoker);
      assertEquals(0, controlConnectionThreadMap.size());
     
View Full Code Here

      client.invoke(CALLBACK_TEST);
      assertEquals(1, testCallbackHandler.counter);
      log.info("callback handler is installed");
     
      // Verify that "timeout" is used correctly.
      ServerInvoker serverInvoker = connector.getServerInvoker();
      Map configuration = serverInvoker.getConfiguration();
      assertEquals("3000", configuration.get(ServerInvoker.TIMEOUT));

      // Verify that "timeout" is used in the absence of "callbackTimeout".
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
View Full Code Here

      client.invoke(CALLBACK_TEST);
      assertEquals(1, testCallbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "timeout" is used correctly.
      ServerInvoker serverInvoker = connector.getServerInvoker();
      Map configuration = serverInvoker.getConfiguration();
      assertEquals("3000", configuration.get(ServerInvoker.TIMEOUT));

      // Verify that "callbackTimeout" is used correctly.
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
View Full Code Here

      client.invoke(CALLBACK_TEST);
      assertEquals(1, testCallbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "timeout" is used correctly.
      ServerInvoker serverInvoker = connector.getServerInvoker();
      Map configuration = serverInvoker.getConfiguration();
      assertEquals("3000", configuration.get(ServerInvoker.TIMEOUT));

      // Verify that "callbackTimeout" is used correctly.
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
View Full Code Here

      client.invoke(CALLBACK_TEST);
      assertEquals(1, testCallbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "timeout" is used in the absence of "callbackTimeout".
      ServerInvoker serverInvoker = connector.getServerInvoker();
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
      Map callbackHandlers = (Map) field.get(serverInvoker);
      assertEquals(1, callbackHandlers.size());
      Object o = callbackHandlers.values().iterator().next();
View Full Code Here

      client.invoke(CALLBACK_TEST);
      assertEquals(1, testCallbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "callbackTimeout" is used correctly.
      ServerInvoker serverInvoker = connector.getServerInvoker();
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
      Map callbackHandlers = (Map) field.get(serverInvoker);
      assertEquals(1, callbackHandlers.size());
      Object o = callbackHandlers.values().iterator().next();
View Full Code Here

TOP

Related Classes of org.jboss.remoting.ServerInvoker$InvalidStateException

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.