[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/bisocket ...
Ron Sigal
ron_sigal at yahoo.com
Sat Aug 4 19:06:17 EDT 2007
User: rsigal
Date: 07/08/04 19:06:17
Modified: src/main/org/jboss/remoting/transport/bisocket Tag:
remoting_2_2_0_GA BisocketClientInvoker.java
Log:
JBREM-784: Added listenerIdToControlSocketsMap.
Revision Changes Path
No revision
No revision
1.1.2.13.2.9 +34 -11 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.13.2.8
retrieving revision 1.1.2.13.2.9
diff -u -b -r1.1.2.13.2.8 -r1.1.2.13.2.9
--- BisocketClientInvoker.java 4 Aug 2007 20:49:33 -0000 1.1.2.13.2.8
+++ BisocketClientInvoker.java 4 Aug 2007 23:06:17 -0000 1.1.2.13.2.9
@@ -72,6 +72,7 @@
private static Map listenerIdToClientInvokerMap = Collections.synchronizedMap(new HashMap());
private static Map listenerIdToCallbackClientInvokerMap = Collections.synchronizedMap(new HashMap());
private static Map listenerIdToSocketsMap = new HashMap();
+ private static Map listenerIdToControlSocketsMap = new HashMap();
private static Timer timer;
private static Object timerLock = new Object();
@@ -108,10 +109,24 @@
}
- static void transferSocket(String listenerId, Socket socket)
+ static void transferSocket(String listenerId, Socket socket, boolean isControlSocket)
{
Set sockets = null;
+ if (isControlSocket)
+ {
+ synchronized (listenerIdToControlSocketsMap)
+ {
+ sockets = (Set) listenerIdToControlSocketsMap.get(listenerId);
+ if (sockets == null)
+ {
+ sockets = new HashSet();
+ listenerIdToControlSocketsMap.put(listenerId, sockets);
+ }
+ }
+ }
+ else
+ {
synchronized (listenerIdToSocketsMap)
{
sockets = (Set) listenerIdToSocketsMap.get(listenerId);
@@ -121,6 +136,7 @@
listenerIdToSocketsMap.put(listenerId, sockets);
}
}
+ }
synchronized (sockets)
{
@@ -216,13 +232,13 @@
{
Set sockets = null;
- synchronized (listenerIdToSocketsMap)
+ synchronized (listenerIdToControlSocketsMap)
{
- sockets = (Set) listenerIdToSocketsMap.get(listenerId);
+ sockets = (Set) listenerIdToControlSocketsMap.get(listenerId);
if (sockets == null)
{
sockets = new HashSet();
- listenerIdToSocketsMap.put(listenerId, sockets);
+ listenerIdToControlSocketsMap.put(listenerId, sockets);
}
}
@@ -325,6 +341,7 @@
super.handleDisconnect();
}
+ listenerIdToControlSocketsMap.remove(listenerId);
listenerIdToSocketsMap.remove(listenerId);
if (pingTimerTask != null)
pingTimerTask.shutDown();
@@ -388,6 +405,12 @@
synchronized (listenerIdToSocketsMap)
{
sockets = (Set) listenerIdToSocketsMap.get(listenerId);
+
+ if (sockets == null)
+ {
+ sockets = new HashSet();
+ listenerIdToSocketsMap.put(listenerId, sockets);
+ }
}
synchronized (controlLock)
More information about the jboss-cvs-commits
mailing list