Package org.jboss.remoting.transport.socket

Examples of org.jboss.remoting.transport.socket.ServerThread


      Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(serverInvoker);
      Set threads = clientpool.getContents();
      assertEquals(1, threads.size());
      ServerThread serverThread = (ServerThread) threads.iterator().next();
      field = ServerThread.class.getDeclaredField("socketWrapper");
      field.setAccessible(true);
      assertTrue(field.get(serverThread) instanceof ServerSocketWrapper);
      ServerSocketWrapper serverWrapper = (ServerSocketWrapper) field.get(serverThread);
      assertEquals(3000, serverWrapper.getTimeout());
View Full Code Here


      SocketServerInvoker serverInvoker = (SocketServerInvoker) connector.getServerInvoker();
      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(serverInvoker);
      assertEquals(1, clientpool.size());
      ServerThread st = (ServerThread) clientpool.getContents().iterator().next();
     
      while (clientpool.size() > 0)
      {
         st.evict();
         Thread.sleep(1000);
      }
     
      field = SocketServerInvoker.class.getDeclaredField("threadpool");
      field.setAccessible(true);
View Full Code Here

      SocketServerInvoker serverInvoker = (SocketServerInvoker) connector.getServerInvoker();
      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(serverInvoker);
      assertEquals(1, clientpool.size());
      ServerThread st = (ServerThread) clientpool.getContents().iterator().next();
     
      while (clientpool.size() > 0)
      {
         st.evict();
         Thread.sleep(1000);
      }
     
      field = SocketServerInvoker.class.getDeclaredField("threadpool");
      field.setAccessible(true);
View Full Code Here

               LRUPool clientpool = (LRUPool) field.get(ssi);
               Set threads = clientpool.getContents();
               Iterator it = threads.iterator();
               while (it.hasNext())
               {
                  ServerThread t = (ServerThread) it.next();
                  t.shutdown();
               }

               ssi.setMaxPoolSize(0);
               log.info("server is disabled");
            }
View Full Code Here

      Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool pool = (LRUPool) field.get(invoker);
      Set keys = pool.getContents();
      assertEquals(1, keys.size());
      ServerThread t = (ServerThread) keys.iterator().next();
      field = ServerThread.class.getDeclaredField("socket");
      field.setAccessible(true);
      Socket socket = (Socket) field.get(t);
      doSocketTest(socket);
     
View Full Code Here

      Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool pool = (LRUPool) field.get(invoker);
      Set keys = pool.getContents();
      assertEquals(1, keys.size());
      ServerThread t = (ServerThread) keys.iterator().next();
      field = ServerThread.class.getDeclaredField("socket");
      field.setAccessible(true);
      Socket socket = (Socket) field.get(t);
      doSocketTest(socket);
     
View Full Code Here

      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(ssi);
      assertEquals(1, clientpool.size());
      Set threads = clientpool.getContents();
      ServerThread serverThread = (ServerThread) threads.iterator().next();
      field = ServerThread.class.getDeclaredField("socketWrapper");
      field.setAccessible(true);
      ServerSocketWrapper ssw = (ServerSocketWrapper) field.get(serverThread);
      field = ClientSocketWrapper.class.getDeclaredField("in");
      field.setAccessible(true);
View Full Code Here

      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(ssi);
      assertEquals(1, clientpool.size());
      Set threads = clientpool.getContents();
      ServerThread serverThread = (ServerThread) threads.iterator().next();
      field = ServerThread.class.getDeclaredField("socketWrapper");
      field.setAccessible(true);
      ServerSocketWrapper ssw = (ServerSocketWrapper) field.get(serverThread);
      field = ClientSocketWrapper.class.getDeclaredField("in");
      field.setAccessible(true);
View Full Code Here

               LRUPool clientpool = (LRUPool) field.get(ssi);
               Set threads = clientpool.getContents();
               Iterator it = threads.iterator();
               while (it.hasNext())
               {
                  ServerThread t = (ServerThread) it.next();
                  t.shutdown();
               }

               ssi.setMaxPoolSize(0);
               log.info("server is disabled");
            }
View Full Code Here

      Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(invoker);
      assertEquals(1, clientpool.size());
      Set s =  clientpool.getContents();
      ServerThread serverThread1 = (ServerThread) s.iterator().next();
     
      // Get threadpool.
      field = SocketServerInvoker.class.getDeclaredField("threadpool");
      field.setAccessible(true);
      LinkedList threadpool = (LinkedList) field.get(invoker);
      assertEquals(0, threadpool.size());
     
      // Wait for ServerThread to time out.
      Thread.sleep(6000);
      for (int i = 0; i < 5; i++)
      {
         Thread.sleep(2000);
         if (clientpool.size() == 0) break;
      }
     
      if (clientpool.size() > 0)
      {
         fail("expect clientpool.size() == 0");
      }
     
      // Verify original ServerThread was returned to threadpool.
      assertEquals(1, threadpool.size());
      assertEquals(serverThread1, threadpool.iterator().next());
     
      // Make another invocation and verify ServerThread was reused.
      client.invoke("xyz");
      assertEquals(1, clientpool.size());
      s =  clientpool.getContents();
      ServerThread serverThread2 = (ServerThread) s.iterator().next();
      assertEquals(serverThread1, serverThread2);
     
      client.disconnect();
      shutdownServer();
      log.info(getName() + " PASSES");
View Full Code Here

TOP

Related Classes of org.jboss.remoting.transport.socket.ServerThread

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.