Package org.jboss.remoting.transport.multiplex.utility

Examples of org.jboss.remoting.transport.multiplex.utility.AddressPair


         callbackConnector.start();

         assertTrue(callbackConnector.isStarted());
         assertFalse(callbackConnector.getServerInvoker().isStarted());
         assertTrue(MultiplexServerInvoker.getSocketGroupMap().containsKey("id"));
         AddressPair addressPair = new AddressPair("localhost", connectPort, "localhost", freePort);
         assertFalse(MultiplexServerInvoker.getAddressPairMap().containsKey(addressPair));
        
         int CLIENT_COUNT = 5;
         Client[] clients = new Client[CLIENT_COUNT];
         String locatorURI = serverLocatorURI + "/?clientMultiplexId=id";
View Full Code Here


         callbackConnector.start();

         assertTrue(callbackConnector.isStarted());
         assertFalse(callbackConnector.getServerInvoker().isStarted());
         assertTrue(MultiplexServerInvoker.getSocketGroupMap().containsKey("id"));
         AddressPair addressPair = new AddressPair("localhost", connectPort, "localhost", freePort);
         assertFalse(MultiplexServerInvoker.getAddressPairMap().containsKey(addressPair));
        
         int CLIENT_COUNT = 5;
         Client[] clients = new Client[CLIENT_COUNT];
         Object o = MultiplexServerInvoker.getSocketGroupMap().get("id");
View Full Code Here

         callbackConnector.start();

         assertTrue(callbackConnector.isStarted());
         assertFalse(callbackConnector.getServerInvoker().isStarted());
         assertTrue(MultiplexServerInvoker.getSocketGroupMap().containsKey("id"));
         AddressPair addressPair = new AddressPair("localhost", connectPort, "localhost", freePort);
         assertFalse(MultiplexServerInvoker.getAddressPairMap().containsKey(addressPair));
        
         Client[] clients = new Client[5];
         Object o = MultiplexServerInvoker.getSocketGroupMap().get("id");
         MultiplexServerInvoker.SocketGroupInfo socketGroupInfo = (MultiplexServerInvoker.SocketGroupInfo) o;
View Full Code Here

      log.info("entering testMultipleClientsMixedLocatorsNoServer()");
     
      try
      {
         int freePort = PortUtil.findFreePort("localhost");
         AddressPair addressPair = new AddressPair("localhost", connectPort, "localhost", freePort);
         Client[] clients = new Client[5];
        
         String basicLocatorURI = serverLocatorURI;
         basicLocatorURI += "/?clientMultiplexId=id&muiltiplexBindHost=localhost&multiplexBindPort=" + freePort;
         InvokerLocator locatorClient = new InvokerLocator(basicLocatorURI + "&invoker=1");
View Full Code Here

         callbackConnector.start();

         assertTrue(callbackConnector.isStarted());
         assertTrue(callbackConnector.getServerInvoker().isStarted());
         assertTrue(MultiplexServerInvoker.getSocketGroupMap().containsKey("id"));
         AddressPair addressPair = new AddressPair("localhost", connectPort, "localhost", freePort);
         assertTrue(MultiplexServerInvoker.getAddressPairMap().containsKey(addressPair));
        
         callbackConnector.stop();

         assertFalse(MultiplexServerInvoker.getSocketGroupMap().containsKey("id"));
View Full Code Here

         Connector callbackConnector1 = new Connector(callbackURI);
        
         callbackConnector1.start();
         assertTrue(callbackConnector1.isStarted());
         assertTrue(MultiplexServerInvoker.getSocketGroupMap().containsKey("id"));
         AddressPair addressPair = new AddressPair("localhost", connectPort, "localhost", freePort);
         assertTrue(MultiplexServerInvoker.getAddressPairMap().containsKey(addressPair));
        
         try
         {
            Connector callbackConnector2  = new Connector(callbackURI + "&blah");
View Full Code Here

          socketGroupInfo.getBindAddress() != null &&
          addressPair == null)
      {
         String bindHost = socketGroupInfo.getBindAddress().getHostName();
         int bindPort = socketGroupInfo.getBindPort();
         addressPair = new AddressPair(connectHost, connectPort, bindHost, bindPort);
      }

      readyToRun = true;
   }
View Full Code Here

            socketGroupInfo.setConnectPort(connectPort);
            socketGroupInfo.addClientInvoker(this);

            // We got socketGroupInfo by socketGroupId.  Make sure it is also stored by AddressPair.
            bindHost = bindAddress.getHostName();
            addressPair = new AddressPair(connectHost, connectPort, bindHost, bindPort);
            MultiplexServerInvoker.getAddressPairMap().put(addressPair, socketGroupInfo);

            MultiplexServerInvoker serverInvoker = socketGroupInfo.getServerInvoker();
            if (serverInvoker != null)
               serverInvoker.finishStart();

            finishStart();
            return;
         }

         bindHost = (String) parameters.get(Multiplex.MULTIPLEX_BIND_HOST);
         bindPortString = (String) parameters.get(Multiplex.MULTIPLEX_BIND_PORT);

         if (bindHost != null && bindPortString == null)
         {
            bindPortString = "0";
         }

         if (bindHost == null && bindPortString != null)
         {
            bindHost = "localhost";
         }

         if (bindHost != null)
         {
            log.debug("client rule 2");

            try
            {
               bindPort = Integer.parseInt(bindPortString);
            }
            catch (NumberFormatException e)
            {
               throw new IOException("number format error for bindPort: " + bindPortString);
            }

            if (bindPort != 0)
            {
               bindSocketAddress = new InetSocketAddress(bindHost, bindPort);
               addressPair = new AddressPair(connectHost, connectPort, bindHost, bindPort);
               socketGroupInfo = (SocketGroupInfo) MultiplexServerInvoker.getAddressPairMap().get(addressPair);
            }

            // If socketGroupInfo exists, it's because it was created, along with a priming socket, by a
            // MultiplexServerInvoker.  Note that we don't look for a match if the bind port was
View Full Code Here

     
      if (socketGroupInfo != null && addressPair == null)
      {
         String connectHost = socketGroupInfo.getConnectAddress().getHostName();
         int connectPort = socketGroupInfo.getConnectPort();
         addressPair = new AddressPair(connectHost, connectPort, bindHost, bindPort);
      }
     
      try
      {
         super.start();
View Full Code Here

                             bindAddress, bindPort, configuration, getTimeout());
      }

      // We got socketGroupInfo by socketGroupId.  Make sure it is also stored by AddressPair.
      String connectHost = connectAddress.getHostName();
      addressPair = new AddressPair(connectHost, connectPort, bindHost, bindPort);
      addressPairMap.put(addressPair, socketGroupInfo);
   }
View Full Code Here

TOP

Related Classes of org.jboss.remoting.transport.multiplex.utility.AddressPair

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.