[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...

Tom Elrod tom.elrod at jboss.com
Fri Jan 5 11:25:54 EST 2007


  User: telrod  
  Date: 07/01/05 11:25:54

  Modified:    src/main/org/jboss/remoting  ServerInvoker.java
  Log:
  JBREM-660 - adding formal local transport
  
  Revision  Changes    Path
  1.56      +15 -13    JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ServerInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -b -r1.55 -r1.56
  --- ServerInvoker.java	27 Dec 2006 05:44:14 -0000	1.55
  +++ ServerInvoker.java	5 Jan 2007 16:25:54 -0000	1.56
  @@ -58,7 +58,7 @@
    *
    * @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
    * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
  - * @version $Revision: 1.55 $
  + * @version $Revision: 1.56 $
    */
   public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean
   {
  @@ -242,12 +242,7 @@
         int port = locator.getPort();
         if(port <= 0)
         {
  -         port = PortUtil.findFreePort(locator.getHost());
  -         // re-write locator since the port is different
  -         InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(), locator.getHost(), port, locator.getPath(), locator.getParameters());
  -         // need to update the locator key used in the invoker registry
  -         InvokerRegistry.updateServerInvokerLocator(locator, newLocator);
  -         this.locator = newLocator;
  +         port = assignPort();
         }
   
         // set the bind address
  @@ -287,12 +282,7 @@
               serverBindPort = Integer.parseInt(serverBindPortString);
               if(serverBindPort <= 0)
               {
  -               serverBindPort = PortUtil.findFreePort(locator.getHost());
  -               // re-write locator since the port is different
  -               InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(), locator.getHost(), serverBindPort, locator.getPath(), locator.getParameters());
  -               // need to update the locator key used in the invoker registry
  -               InvokerRegistry.updateServerInvokerLocator(locator, newLocator);
  -               this.locator = newLocator;
  +               serverBindPort = assignPort();
               }
   
            }
  @@ -346,6 +336,18 @@
         createServerSocketFactory();
      }
   
  +   protected int assignPort() throws IOException
  +   {
  +      int port;
  +      port = PortUtil.findFreePort(locator.getHost());
  +      // re-write locator since the port is different
  +      InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(), locator.getHost(), port, locator.getPath(), locator.getParameters());
  +      // need to update the locator key used in the invoker registry
  +      InvokerRegistry.updateServerInvokerLocator(locator, newLocator);
  +      this.locator = newLocator;
  +      return port;
  +   }
  +
      public void setServerSocketFactory(ServerSocketFactory serverSocketFactory)
      {
         this.serverSocketFactory = serverSocketFactory;
  
  
  



More information about the jboss-cvs-commits mailing list