Package org.jboss.remoting

Examples of org.jboss.remoting.Home


            InetAddress ia = (InetAddress) e2.nextElement();
            String host = ia.getHostAddress();
            boolean isIPv6 = host.indexOf('[') >= 0 || host.indexOf(':') >= 0;
            if (isIPv6) host = '[' + host + ']';
            log.info("host: " + host);
            Home h = new Home(host, -1);
            homes.add(h);
            if (homes.size() >= MAX_HOMES)
               break loop;
         }
      }
     
      Home h = (Home) homes.get(0);
      StringBuffer sb = new StringBuffer(h.host);
      for (int i = 1; i < homes.size(); i++)
      {
         h = (Home) homes.get(i);
         sb.append('!').append(h.host);
View Full Code Here


      Field field = BisocketServerInvoker.class.getDeclaredField("secondaryLocator");
      field.setAccessible(true);
      InvokerLocator secondaryLocator = (InvokerLocator) field.get(invoker);
      log.info("secondaryLocator: " + secondaryLocator);
      List homes = secondaryLocator.getHomeList();
      Home h = (Home) homes.get(0);
      StringBuffer sb2 = new StringBuffer(Integer.toString(h.port));
      for (int i = 1; i < homes.size(); i++)
      {
         h = (Home) homes.get(i);
         sb2.append('!').append(h.port);
View Full Code Here

      Field field = BisocketServerInvoker.class.getDeclaredField("secondaryLocator");
      field.setAccessible(true);
      InvokerLocator secondaryLocator = (InvokerLocator) field.get(invoker);
      log.info("secondaryLocator: " + secondaryLocator);
      List homes = secondaryLocator.getHomeList();
      Home h = (Home) homes.get(0);
      StringBuffer sb3 = new StringBuffer(Integer.toString(h.port));
      for (int i = 1; i < homes.size(); i++)
      {
         h = (Home) homes.get(i);
         sb3.append('!').append(h.port);
View Full Code Here

      Field field = BisocketServerInvoker.class.getDeclaredField("secondaryLocator");
      field.setAccessible(true);
      InvokerLocator secondaryLocator = (InvokerLocator) field.get(invoker);
      log.info("secondaryLocator: " + secondaryLocator);
      List homes = secondaryLocator.getHomeList();
      Home h = (Home) homes.get(0);
      StringBuffer sb3 = new StringBuffer(Integer.toString(h.port));
      for (int i = 1; i < homes.size(); i++)
      {
         h = (Home) homes.get(i);
         sb3.append('!').append(h.port);
View Full Code Here

      assertEquals("multihome", locator.getHost());
      String connectHomes = locator.getConnectHomes();
      assertEquals("a.b:55!c.d:44!e.f:66", connectHomes);
      List connectHomeList = locator.getConnectHomeList();
      assertEquals(3, connectHomeList.size());
      assertEquals(new Home("a.b", 55), connectHomeList.get(0));
      assertEquals(new Home("c.d", 44), connectHomeList.get(1));
      assertEquals(new Home("e.f", 66), connectHomeList.get(2));
      String homes = locator.getHomes();
      assertEquals("g.h:77!i.j:44", homes);
      List homeList = locator.getHomeList();
      assertEquals(2, homeList.size());
      assertEquals(new Home("g.h", 77), homeList.get(0));
      assertEquals(new Home("i.j", 44), homeList.get(1));
     
      url = "socket://multihome:44/?homes=a.b:55!c.d!e.f:66";
      locator = new InvokerLocator(url);
      assertEquals("multihome", locator.getHost());
      homes = locator.getHomes();
      assertEquals("a.b:55!c.d:44!e.f:66", homes);
      homeList = locator.getHomeList();
      assertEquals(3, homeList.size());
      assertEquals(new Home("a.b", 55), homeList.get(0));
      assertEquals(new Home("c.d", 44), homeList.get(1));
      assertEquals(new Home("e.f", 66), homeList.get(2));
      connectHomes = locator.getConnectHomes();
      assertEquals("", connectHomes);
      connectHomeList = locator.getConnectHomeList();
      assertEquals(0, connectHomeList.size());
     
      // Test with host != "multihome".
      url = "socket://jboss.org:44/?connecthomes=a.b:55!c.d!e.f:66&homes=g.h:77!i.j";
      locator = new InvokerLocator(url);
      assertEquals("jboss.org", locator.getHost());
      assertEquals(44, locator.getPort());
      assertEquals("g.h:77!i.j:44", locator.getHomes());
      assertEquals(2, locator.getHomeList().size());
      assertTrue(locator.getHomeList().contains(new Home("g.h", 77)));
      assertTrue(locator.getHomeList().contains(new Home("i.j", 44)));
      assertEquals("jboss.org:44", locator.getConnectHomes());
      assertEquals(1, locator.getConnectHomeList().size());
      assertTrue(locator.getConnectHomeList().contains(new Home("jboss.org", 44)));
     
      url = "socket://jboss.org:44/?homes=a.b:55!c.d!e.f:66";
      locator = new InvokerLocator(url);
      assertEquals("jboss.org", locator.getHost());
      assertEquals(44, locator.getPort());
      assertEquals("a.b:55!c.d:44!e.f:66", locator.getHomes());
      homeList = locator.getHomeList();
      assertEquals(3, homeList.size());
      assertTrue(homeList.contains(new Home("a.b", 55)));
      assertTrue(homeList.contains(new Home("c.d", 44)));
      assertTrue(homeList.contains(new Home("e.f", 66)));
     
      connectHomes = locator.getConnectHomes();
      assertEquals("jboss.org:44", connectHomes);
      connectHomeList = locator.getConnectHomeList();
      assertEquals(1, connectHomeList.size());
      assertEquals(new Home("jboss.org", 44), connectHomeList.get(0));
     
      // Test InvokerLocator.isMultihome().
      locator = new InvokerLocator("socket://jboss.org:44");
      assertFalse(locator.isMultihome());
      locator = new InvokerLocator("socket://jboss.org:44/?homes=a.b:55!c.d!e.f:66");
View Full Code Here

      Iterator it = serverLocator.getConnectHomeList().iterator();
      while (it.hasNext())
      {
         // Create client.
         Home h = (Home) it.next();
         String path = serverLocator.getPath();
         Map parameters = serverLocator.getParameters();
         InvokerLocator clientLocator = new InvokerLocator(getTransport(), h.host, h.port, path, parameters);
         log.info("locator: " + clientLocator);
         HashMap clientConfig = new HashMap();
View Full Code Here

     
      List homes = serverLocator.getConnectHomeList();
      for (int i = 0; i < homes.size(); i++)
      {
         // Create client.
         Home h = (Home) homes.get(i);
         String path = serverLocator.getPath();
         Map parameters = serverLocator.getParameters();
         InvokerLocator clientLocator = new InvokerLocator(getTransport(), h.host, h.port, path, parameters);
         log.info("locator: " + clientLocator);
         HashMap clientConfig = new HashMap();
View Full Code Here

    */
   protected void handleConnect()
   throws ConnectionFailedException
  
      int registryPort = getRegistryPort(locator);
      Home home = null;
      Exception savedException = null;
      Iterator it = getConnectHomes().iterator();
     
      while (it.hasNext())
      {
View Full Code Here

      InvokerLocator savedLocator = locator;
      String protocol = savedLocator.getProtocol();
      String path = savedLocator.getPath();
      Map params = savedLocator.getParameters();
      List homes = locator.getConnectHomeList();
      Home home = null;
     
      Iterator it = homes.iterator();
      while (it.hasNext())
      {
         try
View Full Code Here

         for (int i = 0; i < protocolHandlers.size(); i++)
         {
            try
            {
               final ProtocolHandler protocolHandler = (ProtocolHandler) protocolHandlers.get(i);
               Home home = (Home) getHomes().get(i);
               setProperty(protocolHandler, "address", home.host);
               setProperty(protocolHandler, "port", "" + home.port);

               //TODO: -TME - Should not have to hard set this every time.  Should
               // be a way to figure out if this is needed or not.
View Full Code Here

TOP

Related Classes of org.jboss.remoting.Home

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.