[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/bisocket ...
Ron Sigal
ron_sigal at yahoo.com
Wed Aug 22 17:18:20 EDT 2007
User: rsigal
Date: 07/08/22 17:18:20
Modified: src/main/org/jboss/remoting/transport/bisocket Tag:
remoting_2_2_2_experimental
BisocketServerInvoker.java
Log:
JBREM-749: (1) Added secondaryConnectPort; (2) gets host from InvokerLocator to create secondary InvokerLocator.
Revision Changes Path
No revision
No revision
1.1.2.17.2.7.2.2 +51 -17 JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BisocketServerInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java,v
retrieving revision 1.1.2.17.2.7.2.1
retrieving revision 1.1.2.17.2.7.2.2
diff -u -b -r1.1.2.17.2.7.2.1 -r1.1.2.17.2.7.2.2
--- BisocketServerInvoker.java 20 Aug 2007 06:14:10 -0000 1.1.2.17.2.7.2.1
+++ BisocketServerInvoker.java 22 Aug 2007 21:18:20 -0000 1.1.2.17.2.7.2.2
@@ -58,7 +58,7 @@
/**
*
* @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @version $Revision: 1.1.2.17.2.7.2.1 $
+ * @version $Revision: 1.1.2.17.2.7.2.2 $
* <p>
* Copyright Nov 23, 2006
* </p>
@@ -84,7 +84,8 @@
private int controlConnectionRestarts = Bisocket.MAX_CONTROL_CONNECTION_RESTARTS_DEFAULT;
private ControlMonitorTimerTask controlMonitorTimerTask;
protected boolean isCallbackServer = false;
- protected int secondaryPort = -1;
+ protected int secondaryBindPort = -1;
+ protected int secondaryConnectPort = -1;
public static BisocketServerInvoker getBisocketServerInvoker(String listenerId)
@@ -176,25 +177,28 @@
{
super.start();
InetAddress host = getServerSocket().getInetAddress();
- if (secondaryPort < 0)
+ if (secondaryBindPort < 0)
{
- secondaryPort = PortUtil.findFreePort(host.getHostAddress());
+ secondaryBindPort = PortUtil.findFreePort(host.getHostAddress());
}
if (serverSocketFactory != null)
{
- secondaryServerSocket = serverSocketFactory.createServerSocket(secondaryPort, 0, host);
+ secondaryServerSocket = serverSocketFactory.createServerSocket(secondaryBindPort, 0, host);
}
else
{
- secondaryServerSocket = new ServerSocket(secondaryPort, 0, host);
+ secondaryServerSocket = new ServerSocket(secondaryBindPort, 0, host);
}
checkSecondaryServerSocketWrapper();
- secondaryLocator = new InvokerLocator(null, host.getHostAddress(), secondaryPort, null, null);
+
+ String connectAddress = getLocator().getHost();
+ int connectPort = secondaryConnectPort > 0 ? secondaryConnectPort : secondaryBindPort;
+ secondaryLocator = new InvokerLocator(null, connectAddress, connectPort, null, null);
secondaryServerSocketThread = new SecondaryServerSocketThread(secondaryServerSocket);
secondaryServerSocketThread.setName("secondaryServerSocketThread");
secondaryServerSocketThread.setDaemon(true);
secondaryServerSocketThread.start();
- log.debug("started secondary port: " + host + ":" + secondaryPort);
+ log.debug("started secondary port: " + host + ":" + secondaryBindPort);
}
}
@@ -378,15 +382,27 @@
}
- public int getSecondaryPort()
+ public int getSecondaryBindPort()
+ {
+ return secondaryBindPort;
+ }
+
+
+ public void setSecondaryBindPort(int secondaryPort)
{
- return secondaryPort;
+ this.secondaryBindPort = secondaryPort;
}
- public void setSecondaryPort(int secondaryPort)
+ public int getSecondaryConnectPort()
{
- this.secondaryPort = secondaryPort;
+ return secondaryConnectPort;
+ }
+
+
+ public void setSecondaryConnectPort(int secondaryConnectPort)
+ {
+ this.secondaryConnectPort = secondaryConnectPort;
}
@@ -455,22 +471,40 @@
pingWindow = pingWindowFactor * pingFrequency;
- o = configuration.get(Bisocket.SECONDARY_PORT);
+ o = configuration.get(Bisocket.SECONDARY_BIND_PORT);
+ if (o instanceof String && ((String) o).length() > 0)
+ {
+ try
+ {
+ secondaryBindPort = Integer.valueOf(((String) o)).intValue();
+ log.debug(this + " setting secondaryBindPort to " + secondaryBindPort);
+ }
+ catch (NumberFormatException e)
+ {
+ log.warn("Invalid format for " + "\"" + Bisocket.SECONDARY_BIND_PORT + "\": " + o);
+ }
+ }
+ else if (o != null)
+ {
+ log.warn("\"" + Bisocket.SECONDARY_BIND_PORT + "\" must be specified as a String");
+ }
+
+ o = configuration.get(Bisocket.SECONDARY_CONNECT_PORT);
if (o instanceof String && ((String) o).length() > 0)
{
try
{
- secondaryPort = Integer.valueOf(((String) o)).intValue();
- log.debug(this + " setting secondaryPort to " + secondaryPort);
+ secondaryConnectPort = Integer.valueOf(((String) o)).intValue();
+ log.debug(this + " setting secondaryConnectPort to " + secondaryConnectPort);
}
catch (NumberFormatException e)
{
- log.warn("Invalid format for " + "\"" + Bisocket.SECONDARY_PORT + "\": " + o);
+ log.warn("Invalid format for " + "\"" + Bisocket.SECONDARY_CONNECT_PORT + "\": " + o);
}
}
else if (o != null)
{
- log.warn("\"" + Bisocket.SECONDARY_PORT + "\" must be specified as a String");
+ log.warn("\"" + Bisocket.SECONDARY_CONNECT_PORT + "\" must be specified as a String");
}
super.setup();
More information about the jboss-cvs-commits
mailing list