[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Ron Sigal
ron_sigal at yahoo.com
Wed Feb 21 05:56:52 EST 2007
User: rsigal
Date: 07/02/21 05:56:52
Modified: src/main/org/jboss/remoting Tag: remoting_2_x
LeasePinger.java
Log:
JBREM-598, JBREM-657: Added disconnectTimeout variable.
Revision Changes Path
No revision
No revision
1.8.2.10 +23 -3 JBossRemoting/src/main/org/jboss/remoting/LeasePinger.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LeasePinger.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/LeasePinger.java,v
retrieving revision 1.8.2.9
retrieving revision 1.8.2.10
diff -u -b -r1.8.2.9 -r1.8.2.10
--- LeasePinger.java 16 Feb 2007 04:13:09 -0000 1.8.2.9
+++ LeasePinger.java 21 Feb 2007 10:56:52 -0000 1.8.2.10
@@ -24,6 +24,7 @@
private static final Logger log = Logger.getLogger(LeasePinger.class);
public static final long DEFAULT_LEASE_PERIOD = 5000;
+ public static final int DEFAULT_DISCONNECT_TIMEOUT = -1;
// Static ---------------------------------------------------------------------------------------
@@ -42,6 +43,7 @@
private TimerTask timerTask = null;
private long pingPeriod = -1;
+ private int disconnectTimeout = DEFAULT_DISCONNECT_TIMEOUT;
// Constructors ---------------------------------------------------------------------------------
@@ -76,8 +78,12 @@
{
// sending request map with no ClientHolders will indicate to server
// that is full disconnect (for client invoker)
- HashMap metadata = new HashMap(1);
- metadata.put(ServerInvoker.TIMEOUT, "1000");
+ HashMap metadata = null;
+ if (disconnectTimeout >= 0)
+ {
+ metadata = new HashMap(1);
+ metadata.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));
+ }
InvocationRequest ir =
new InvocationRequest(invokerSessionID, null, "$DISCONNECT$", metadata, null, null);
invoker.invoke(ir);
@@ -135,7 +141,9 @@
{
Map clientMap = new HashMap();
clientMap.put(ClientHolder.CLIENT_HOLDER_KEY, holder);
- clientMap.put(ServerInvoker.TIMEOUT, "1000");
+
+ if (disconnectTimeout >= 0)
+ clientMap.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));
InvocationRequest ir = new InvocationRequest(invokerSessionID, null, "$DISCONNECT$",
clientMap, null, null);
@@ -222,6 +230,18 @@
// Protected ------------------------------------------------------------------------------------
+
+ protected int getDisconnectTimeout()
+ {
+ return disconnectTimeout;
+ }
+
+ protected void setDisconnectTimeout(int disconnectTimeout)
+ {
+ this.disconnectTimeout = disconnectTimeout;
+ log.debug(this + " setting disconnect timeout to: " + disconnectTimeout);
+ }
+
// Private --------------------------------------------------------------------------------------
private void sendClientPing()
More information about the jboss-cvs-commits
mailing list