[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/bisocket ...
Ron Sigal
ron_sigal at yahoo.com
Sat Aug 4 16:49:33 EDT 2007
User: rsigal
Date: 07/08/04 16:49:33
Modified: src/main/org/jboss/remoting/transport/bisocket Tag:
remoting_2_2_0_GA BisocketClientInvoker.java
Log:
JBREM-767: Network i/o moved from constructor to handleConnect().
Revision Changes Path
No revision
No revision
1.1.2.13.2.8 +43 -39 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.7
retrieving revision 1.1.2.13.2.8
diff -u -b -r1.1.2.13.2.7 -r1.1.2.13.2.8
--- BisocketClientInvoker.java 2 Aug 2007 07:51:39 -0000 1.1.2.13.2.7
+++ BisocketClientInvoker.java 4 Aug 2007 20:49:33 -0000 1.1.2.13.2.8
@@ -147,7 +147,7 @@
{
isCallbackInvoker = true;
listenerIdToCallbackClientInvokerMap.put(listenerId, this);
- log.debug("registered " + listenerId + " -> " + this);
+ log.debug(this + " :registered " + listenerId + " -> " + this);
}
// look for pingFrequency param
@@ -183,7 +183,35 @@
}
}
}
+ }
+
+ public int getMaxRetries()
+ {
+ return maxRetries;
+ }
+
+
+ public void setMaxRetries(int maxRetries)
+ {
+ this.maxRetries = maxRetries;
+ }
+
+
+ public int getPingFrequency()
+ {
+ return pingFrequency;
+ }
+
+
+ public void setPingFrequency(int pingFrequency)
+ {
+ this.pingFrequency = pingFrequency;
+ }
+
+ protected void handleConnect() throws ConnectionFailedException
+ {
+ // Callback client on server side.
if (isCallbackInvoker)
{
Set sockets = null;
@@ -209,18 +237,25 @@
catch (InterruptedException ignored)
{
log.warn("unexpected interrupt");
- throw new InterruptedIOException("Attempt to create control socket interrupted");
+// throw new InterruptedIOException("Attempt to create control socket interrupted");
}
}
if (sockets.isEmpty())
- throw new IOException("Timed out trying to create control socket");
+ throw new ConnectionFailedException("Timed out trying to create control socket");
Iterator it = sockets.iterator();
controlSocket = (Socket) it.next();
it.remove();
+ try
+ {
controlOutputStream = controlSocket.getOutputStream();
- log.debug("got control socket: " + controlSocket);
+ }
+ catch (IOException e1)
+ {
+ throw new ConnectionFailedException("Unable to get control socket output stream");
+ }
+ log.debug("got control socket( " + listenerId + "): " + controlSocket);
pingTimerTask = new PingTimerTask(this);
synchronized (timerLock)
@@ -241,38 +276,7 @@
}
}
}
- }
- }
-
- public int getMaxRetries()
- {
- return maxRetries;
- }
-
-
- public void setMaxRetries(int maxRetries)
- {
- this.maxRetries = maxRetries;
- }
-
-
- public int getPingFrequency()
- {
- return pingFrequency;
- }
-
-
- public void setPingFrequency(int pingFrequency)
- {
- this.pingFrequency = pingFrequency;
- }
-
- protected void handleConnect() throws ConnectionFailedException
- {
- // Callback client on server side.
- if (isCallbackInvoker)
- {
// Bisocket callback client invoker doesn't share socket pools because of the danger
// that two distinct callback servers could have the same "artifical" port.
pool = new LinkedList();
@@ -412,7 +416,7 @@
Iterator it = sockets.iterator();
Socket socket = (Socket) it.next();
it.remove();
- log.debug("found socket: " + socket);
+ log.debug(this + " found socket (" + listenerId + "): " + socket);
return socket;
}
}
More information about the jboss-cvs-commits
mailing list