[jboss-cvs] JBoss Messaging SVN: r5502 - trunk/src/main/org/jboss/messaging/integration/transports/netty.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 10 08:54:28 EST 2008
Author: ataylor
Date: 2008-12-10 08:54:28 -0500 (Wed, 10 Dec 2008)
New Revision: 5502
Modified:
trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyConnector.java
Log:
connector fix
Modified: trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyConnector.java
===================================================================
--- trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyConnector.java 2008-12-10 13:38:25 UTC (rev 5501)
+++ trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyConnector.java 2008-12-10 13:54:28 UTC (rev 5502)
@@ -386,6 +386,8 @@
private Timer idleClientTimer;
+ private HttpIdleTimerTask task;
+
public void channelConnected(final ChannelHandlerContext ctx, final ChannelStateEvent e) throws Exception
{
super.channelConnected(ctx, e);
@@ -393,7 +395,8 @@
if (httpClientIdleScanPeriod > 0)
{
idleClientTimer = new Timer("Http Idle Timer", true);
- idleClientTimer.schedule(new HttpIdleTimerTask(), httpClientIdleScanPeriod, httpClientIdleScanPeriod);
+ task = new HttpIdleTimerTask();
+ idleClientTimer.schedule(task, httpClientIdleScanPeriod, httpClientIdleScanPeriod);
}
}
@@ -401,6 +404,8 @@
{
if (idleClientTimer != null)
{
+ task.cancel();
+
idleClientTimer.cancel();
}
super.channelClosed(ctx, e);
@@ -440,8 +445,7 @@
private class HttpIdleTimerTask extends TimerTask
{
long currentTime = System.currentTimeMillis();
-
- public void run()
+ public synchronized void run()
{
if (!waitingGet && System.currentTimeMillis() > lastSendTime + httpMaxClientIdleTime)
{
@@ -450,6 +454,11 @@
channel.write(httpRequest);
}
}
+
+ public synchronized boolean cancel()
+ {
+ return super.cancel();
+ }
}
}
More information about the jboss-cvs-commits
mailing list