Package org.jboss.remoting.transport.socket

Examples of org.jboss.remoting.transport.socket.SocketServerInvoker$AcceptThread


      assertEquals(1, callbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "timeout" is used correctly.
      assertTrue(connector.getServerInvoker() instanceof SocketServerInvoker);
      SocketServerInvoker serverInvoker = (SocketServerInvoker) connector.getServerInvoker();
      Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(serverInvoker);
      Set threads = clientpool.getContents();
      assertEquals(1, threads.size());
View Full Code Here


        // create server socket factory
        ServerSocketFactory svrSocketFactory = createServerSocketFactory(keyStorePassword,trustStorePassword,keyStorePath,trustStorePath);
       
        // notice that the invoker has to be explicitly cast to the
        // SocketServerInvoker type               
        SocketServerInvoker socketSvrInvoker = (SocketServerInvoker) connector.getServerInvoker();
        socketSvrInvoker.setServerSocketFactory(svrSocketFactory);
      }
      catch(Exception e){
        e.printStackTrace();
      }     
     
View Full Code Here

      assertEquals(1, callbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "timeout" is used correctly.
      assertTrue(connector.getServerInvoker() instanceof SocketServerInvoker);
      SocketServerInvoker serverInvoker = (SocketServerInvoker) connector.getServerInvoker();
      Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(serverInvoker);
      Set threads = clientpool.getContents();
      assertEquals(1, threads.size());
View Full Code Here

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

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

      assertEquals(1, callbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "callbackTimeout" from Client.addListener() metadata
      // has precedence.
      SocketServerInvoker serverInvoker = (SocketServerInvoker) connector.getServerInvoker();
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
      Map callbackHandlers = (Map) field.get(serverInvoker);
      assertEquals(1, callbackHandlers.size());
      ServerInvokerCallbackHandler serverInvokerCallbackHandler;
View Full Code Here

      assertEquals(1, callbackHandler.counter);
      log.info("callback handler is installed");

      // Verify that "callbackTimeout" from InvokerLocator overrides value
      // in configuration map.
      SocketServerInvoker serverInvoker = (SocketServerInvoker) connector.getServerInvoker();
      Field field = ServerInvoker.class.getDeclaredField("callbackHandlers");
      field.setAccessible(true);
      Map callbackHandlers = (Map) field.get(serverInvoker);
      assertEquals(1, callbackHandlers.size());
      ServerInvokerCallbackHandler serverInvokerCallbackHandler;
View Full Code Here

               // Give the client a chance to connect to the server, then
               // disable the server.
               Thread.sleep(2000);
               ServerInvoker si = connector.getServerInvoker();
               assertTrue(si instanceof SocketServerInvoker);
               SocketServerInvoker ssi = (SocketServerInvoker) si;
               Field field = SocketServerInvoker.class.getDeclaredField("clientpool");
               field.setAccessible(true);
               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");
            }
            catch (Exception e)
            {
               log.info(e);
View Full Code Here

      if(connector != null)
      {
         try
         {
            // check for empty thread pool
            SocketServerInvoker svrInvoker = (SocketServerInvoker)connector.getServerInvoker();
            int threadPoolSize = svrInvoker.getCurrentThreadPoolSize();
            if(threadPoolSize > 0)
            {
               System.out.println("Error - thread pool should be size of 0, but is " + threadPoolSize);
               throw new RuntimeException("Thread pool was not size of 0, but " + threadPoolSize);
            }
View Full Code Here

      OutputStream client_out1 = (OutputStream) field.get(csw);
      assertTrue(client_out1 instanceof ObjectOutputStream);
     
      // Make sure server has object streams.
      assertTrue(connector.getServerInvoker() instanceof SocketServerInvoker);
      SocketServerInvoker ssi = (SocketServerInvoker) connector.getServerInvoker();
      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(ssi);
      assertEquals(1, clientpool.size());
      Set threads = clientpool.getContents();
View Full Code Here

      OutputStream client_out1 = (OutputStream) field.get(csw);
      assertTrue(client_out1 instanceof TestObjectOutputStream);
     
      // Make sure server has object streams from test directory.
      assertTrue(connector.getServerInvoker() instanceof SocketServerInvoker);
      SocketServerInvoker ssi = (SocketServerInvoker) connector.getServerInvoker();
      field = SocketServerInvoker.class.getDeclaredField("clientpool");
      field.setAccessible(true);
      LRUPool clientpool = (LRUPool) field.get(ssi);
      assertEquals(1, clientpool.size());
      Set threads = clientpool.getContents();
View Full Code Here

TOP

Related Classes of org.jboss.remoting.transport.socket.SocketServerInvoker$AcceptThread

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.