Package org.jboss.remoting.transport

Examples of org.jboss.remoting.transport.ClientInvoker


      log.info("clients added callback handler");
     
      Iterator it = invocationHandler.callbackHandlers.iterator();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient = serverInvokerCallbackHandler.getCallbackClient();
      ClientInvoker clientInvoker = callbackClient.getInvoker();
      assertTrue(clientInvoker instanceof BisocketClientInvoker);
     
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
      List pool = (List) field.get(clientInvoker);
View Full Code Here


      ServerInvokerCallbackHandler serverInvokerCallbackHandler1 = (ServerInvokerCallbackHandler) it.next();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler2 = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient1 = serverInvokerCallbackHandler1.getCallbackClient();
      Client callbackClient2 = serverInvokerCallbackHandler2.getCallbackClient();
      assertNotSame(callbackClient1, callbackClient2);
      ClientInvoker clientInvoker1 = callbackClient1.getInvoker();
      assertTrue(clientInvoker1 instanceof BisocketClientInvoker);
      ClientInvoker clientInvoker2 = callbackClient2.getInvoker();
      assertTrue(clientInvoker2 instanceof BisocketClientInvoker);
      assertNotSame(clientInvoker1, clientInvoker2);
     
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
View Full Code Here

      ServerInvokerCallbackHandler serverInvokerCallbackHandler1 = (ServerInvokerCallbackHandler) it.next();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler2 = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient1 = serverInvokerCallbackHandler1.getCallbackClient();
      Client callbackClient2 = serverInvokerCallbackHandler2.getCallbackClient();
      assertNotSame(callbackClient1, callbackClient2);
      ClientInvoker clientInvoker1 = callbackClient1.getInvoker();
      assertTrue(clientInvoker1 instanceof BisocketClientInvoker);
      ClientInvoker clientInvoker2 = callbackClient2.getInvoker();
      assertTrue(clientInvoker2 instanceof BisocketClientInvoker);
      assertNotSame(clientInvoker1, clientInvoker2);
     
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
View Full Code Here

      ServerInvokerCallbackHandler serverInvokerCallbackHandler1 = (ServerInvokerCallbackHandler) it.next();
      ServerInvokerCallbackHandler serverInvokerCallbackHandler2 = (ServerInvokerCallbackHandler) it.next();
      Client callbackClient1 = serverInvokerCallbackHandler1.getCallbackClient();
      Client callbackClient2 = serverInvokerCallbackHandler2.getCallbackClient();
      assertNotSame(callbackClient1, callbackClient2);
      ClientInvoker clientInvoker1 = callbackClient1.getInvoker();
      assertTrue(clientInvoker1 instanceof BisocketClientInvoker);
      ClientInvoker clientInvoker2 = callbackClient2.getInvoker();
      assertTrue(clientInvoker2 instanceof BisocketClientInvoker);
      assertNotSame(clientInvoker1, clientInvoker2);
     
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
View Full Code Here

  
  
   private void configureParameters()
   {
      Map config = new HashMap();
      ClientInvoker invoker = client.getInvoker();
      if (invoker != null)
      {
         config.putAll(invoker.getLocator().getParameters());
      }
      config.putAll(client.getConfiguration());
      config.putAll(metadata);
     
      Object val = config.get(Client.USE_ALL_PARAMS);
View Full Code Here

   public static boolean checkConnection(InvokerLocator locator, Map config) throws Throwable
   {
      boolean pingWorked = false;
      Map configMap = createPingConfig(config, null);
      int pingTimeout = Integer.parseInt((String) configMap.get(ServerInvoker.TIMEOUT));
      ClientInvoker innerClientInvoker = null;

      try
      {
         innerClientInvoker = InvokerRegistry.createClientInvoker(locator, configMap);

         if (!innerClientInvoker.isConnected())
         {
            if (trace) { log.trace("inner client invoker not connected, connecting ..."); }
            innerClientInvoker.connect();
         }

         pingWorked = doCheckConnection(innerClientInvoker, pingTimeout);
      }
      catch (Throwable throwable)
      {
            log.debug("ConnectionValidator unable to connect to server " +
            innerClientInvoker.getLocator().getProtocol() + "://" +
            innerClientInvoker.getLocator().getHost() + ":" +
            innerClientInvoker.getLocator().getPort(), throwable);
      }
      finally
      {
         if (innerClientInvoker != null)
         {
View Full Code Here

         getParametersFromMap(client.getInvoker().getLocator().getParameters());
      }
      getParametersFromMap(client.getConfiguration());
      getParametersFromMap(metadata);
     
      ClientInvoker clientInvoker = client.getInvoker();
      if (clientInvoker instanceof MicroRemoteClientInvoker)
      {
         sharedInvoker = (MicroRemoteClientInvoker) clientInvoker;
         invokerSessionId = sharedInvoker.getSessionId();
      }
View Full Code Here

            {
               log.warn(this + " could not convert " + STOP_LEASE_ON_FAILURE + " value" +
               " to a boolean: must be a String");
            }
         }
         ClientInvoker invoker = client.getInvoker();
         if (invoker == null)
         {
            if (trace) log.trace(this + " client invoker == null");
         }
         else
         {
            if (trace) log.trace(this + " InvokerLocator: " + invoker.getLocator());
         }
         o = config.get(FAILURE_DISCONNECT_TIMEOUT);
         if (trace) log.trace(this + " \"failureDisconnectTimeout\" set to " + o);
         if (o != null)
         {
View Full Code Here

         Client client = new Client(locator, cconfig);
         client.connect();
        
         // Set SocketFactory in ClientInvoker.
         SocketFactory sf4 = getDefaultSocketFactory();
         ClientInvoker clientInvoker = client.getInvoker();
         clientInvoker.setSocketFactory(sf4);
        
         // Verify SocketFactory is the one set in ClientInvoker.
         assertTrue(sf4 == clientInvoker.getSocketFactory());
        
        
         //////////////////////////////////////////////
         /////     Do server side callback test.   ////
         //////////////////////////////////////////////
         Thread.sleep(500);
         freeport = PortUtil.findFreePort(getHostName());
         InvokerLocator callbackLocator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
         HashMap config = new HashMap();
         addExtraCallbackConfig(config);
         Connector callbackConnector = new Connector(callbackLocator.getLocatorURI(), config);
         ServerSocketFactory ssf3 = getDefaultCallbackServerSocketFactory();
         callbackConnector.setServerSocketFactory(ssf3);
         callbackConnector.create();
         callbackConnector.addInvocationHandler("sample", new SampleInvocationHandler());
         callbackConnector.start();
        
         CallbackHandler callbackHandler = new CallbackHandler();
         String callbackHandleObject = "myCallbackHandleObject";
         client.addListener(callbackHandler, callbackLocator, callbackHandleObject);
        
         // Verify that callback succeeded.
         assertEquals(1, callbackHandler.getCallbacks().size());
        
         // Verify callback SocketFactory is the one set in SocketInvoker.
         Field field = ServerInvoker.class.getDeclaredField("handlers");
         field.setAccessible(true);
         Map handlers = (Map) field.get(serverInvoker);
         Object obj = handlers.values().iterator().next();
         SampleInvocationHandler sampleInvocationHandler = (SampleInvocationHandler) obj;
         obj = sampleInvocationHandler.getCallbackHandler();
         ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) obj;
         field = ServerInvokerCallbackHandler.class.getDeclaredField("callBackClient");
         field.setAccessible(true);
         Client callbackClient = (Client) field.get(serverInvokerCallbackHandler);
         ClientInvoker callbackClientInvoker = callbackClient.getInvoker();
         assertTrue(sf2 == callbackClientInvoker.getSocketFactory());
        
         client.disconnect();
         callbackConnector.stop();
         connector.stop();
         log.info(getName() + " PASSES");
View Full Code Here

         SocketFactory sf4 = getDefaultSocketFactory();
         client.setSocketFactory(sf4);
         client.connect();
        
         // Verify SocketFactory is the one set in Client.
         ClientInvoker clientInvoker = client.getInvoker();
         assertTrue(sf4 == clientInvoker.getSocketFactory());
        
        
         //////////////////////////////////////////////
         /////     Do server side callback test.   ////
         //////////////////////////////////////////////
         Thread.sleep(500);
         freeport = PortUtil.findFreePort(getHostName());
         InvokerLocator callbackLocator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
         HashMap config = new HashMap();
         addExtraCallbackConfig(config);
         Connector callbackConnector = new Connector(callbackLocator.getLocatorURI(), config);
         ServerSocketFactory ssf3 = getDefaultCallbackServerSocketFactory();
         callbackConnector.setServerSocketFactory(ssf3);
         callbackConnector.create();
         callbackConnector.addInvocationHandler("sample", new SampleInvocationHandler());
         callbackConnector.start();
        
         CallbackHandler callbackHandler = new CallbackHandler();
         String callbackHandleObject = "myCallbackHandleObject";
         client.addListener(callbackHandler, callbackLocator, callbackHandleObject);
        
         // Verify that callback succeeded.
         assertEquals(1, callbackHandler.getCallbacks().size());
        
         // Verify callback SocketFactory is the one set in Connector.
         Field field = ServerInvoker.class.getDeclaredField("handlers");
         field.setAccessible(true);
         Map handlers = (Map) field.get(serverInvoker);
         Object obj = handlers.values().iterator().next();
         SampleInvocationHandler sampleInvocationHandler = (SampleInvocationHandler) obj;
         obj = sampleInvocationHandler.getCallbackHandler();
         ServerInvokerCallbackHandler serverInvokerCallbackHandler = (ServerInvokerCallbackHandler) obj;
         field = ServerInvokerCallbackHandler.class.getDeclaredField("callBackClient");
         field.setAccessible(true);
         Client callbackClient = (Client) field.get(serverInvokerCallbackHandler);
         ClientInvoker callbackClientInvoker = callbackClient.getInvoker();
         assertTrue(sf2 == callbackClientInvoker.getSocketFactory());
        
         client.disconnect();
         callbackConnector.stop();
         connector.stop();
         log.info(getName() + " PASSES");
View Full Code Here

TOP

Related Classes of org.jboss.remoting.transport.ClientInvoker

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.