[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/bisocket ...
Ron Sigal
ron_sigal at yahoo.com
Wed Mar 14 00:57:01 EDT 2007
User: rsigal
Date: 07/03/14 00:57:01
Modified: src/main/org/jboss/remoting/transport/bisocket Tag:
remoting_2_x BisocketClientInvoker.java
Log:
JBREM-721, JBREM-726: (1) Moved control thread shutdown to BisocketServerInvoker.handleInternalInvocation(); (2) uses maxRetries for getSecondaryInvocatorLocator().
Revision Changes Path
No revision
No revision
1.1.2.12 +31 -13 JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BisocketClientInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -b -r1.1.2.11 -r1.1.2.12
--- BisocketClientInvoker.java 10 Mar 2007 22:11:12 -0000 1.1.2.11
+++ BisocketClientInvoker.java 14 Mar 2007 04:57:01 -0000 1.1.2.12
@@ -76,7 +76,8 @@
protected String listenerId;
- private int pingFrequency = Bisocket.PING_FREQUENCY_DEFAULT;;
+ private int pingFrequency = Bisocket.PING_FREQUENCY_DEFAULT;
+ private int maxRetries = Bisocket.MAX_RETRIES_DEFAULT;
private InvokerLocator secondaryLocator;
private Socket controlSocket;
private OutputStream controlOutputStream;
@@ -101,6 +102,12 @@
}
+ static void removeBisocketClientInvoker(String listenerId)
+ {
+ listenerIdToClientInvokerMap.remove(listenerId);
+ }
+
+
static void transferSocket(String listenerId, Socket socket)
{
Set sockets = null;
@@ -159,6 +166,22 @@
" value of " + val + " to an int value.");
}
}
+
+ val = configuration.get(Bisocket.MAX_RETRIES);
+ if (val != null)
+ {
+ try
+ {
+ int nVal = Integer.valueOf((String) val).intValue();
+ maxRetries = nVal;
+ log.debug("Setting retry limit: " + maxRetries);
+ }
+ catch (Exception e)
+ {
+ log.warn("Could not convert " + Bisocket.MAX_RETRIES +
+ " value of " + val + " to an int value.");
+ }
+ }
}
if (isCallbackInvoker)
@@ -304,17 +327,12 @@
callbackServerInvoker = BisocketServerInvoker.getBisocketServerInvoker(listenerId);
callbackServerInvoker.createControlConnection(listenerId, secondaryLocator);
}
- else if (InternalInvocation.REMOVELISTENER.equals(ii.getMethodName()))
- {
- Map requestPayload = ir.getRequestPayload();
- listenerId = (String) requestPayload.get(Client.LISTENER_ID_KEY);
- listenerIdToClientInvokerMap.remove(listenerId);
- BisocketServerInvoker callbackServerInvoker;
- callbackServerInvoker = BisocketServerInvoker.getBisocketServerInvoker(listenerId);
- if (callbackServerInvoker != null)
- callbackServerInvoker.destroyControlConnection(listenerId);
- }
+ // Rather than handle the REMOVELISTENER case symmetrically, it is
+ // handled when a REMOVECLIENTLISTENER message is received by
+ // BisocketServerInvoker.handleInternalInvocation(). The reason is that
+ // if the Client executes removeListener() with disconnectTimeout == 0,
+ // no REMOVELISTENER message will be sent.
}
}
@@ -400,7 +418,7 @@
InvocationRequest r = new InvocationRequest(null, null, ii, null, null, null);
log.debug("getting secondary locator");
- for (int i = 0; i < 5; i++)
+ for (int i = 0; i < maxRetries; i++)
{
try
{
More information about the jboss-cvs-commits
mailing list