[jboss-cvs] JBoss Messaging SVN: r5498 - 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 05:35:21 EST 2008
Author: ataylor
Date: 2008-12-10 05:35:21 -0500 (Wed, 10 Dec 2008)
New Revision: 5498
Modified:
trunk/src/main/org/jboss/messaging/integration/transports/netty/HttpKeepAliveTask.java
trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyAcceptor.java
Log:
another syncing fix
Modified: trunk/src/main/org/jboss/messaging/integration/transports/netty/HttpKeepAliveTask.java
===================================================================
--- trunk/src/main/org/jboss/messaging/integration/transports/netty/HttpKeepAliveTask.java 2008-12-10 09:59:29 UTC (rev 5497)
+++ trunk/src/main/org/jboss/messaging/integration/transports/netty/HttpKeepAliveTask.java 2008-12-10 10:35:21 UTC (rev 5498)
@@ -33,8 +33,16 @@
public class HttpKeepAliveTask extends TimerTask
{
private final List<HttpAcceptorHandler> handlers = new ArrayList<HttpAcceptorHandler>();
+
+ private boolean cancelled;
+
public synchronized void run()
{
+ if(cancelled)
+ {
+ return;
+ }
+
long time = System.currentTimeMillis();
for (HttpAcceptorHandler handler : handlers)
{
@@ -51,4 +59,10 @@
{
handlers.remove(httpAcceptorHandler);
}
+
+ public synchronized boolean cancel()
+ {
+ cancelled = true;
+ return super.cancel();
+ }
}
Modified: trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyAcceptor.java
===================================================================
--- trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyAcceptor.java 2008-12-10 09:59:29 UTC (rev 5497)
+++ trunk/src/main/org/jboss/messaging/integration/transports/netty/NettyAcceptor.java 2008-12-10 10:35:21 UTC (rev 5498)
@@ -130,7 +130,7 @@
{
httpServerScanPeriod = ConfigurationHelper.getLongProperty(TransportConstants.HTTP_SERVER_SCAN_PERIOD_PROP_NAME, TransportConstants.DEFAULT_HTTP_SERVER_SCAN_PERIOD, configuration);
httpResponseTime = ConfigurationHelper.getLongProperty(TransportConstants.HTTP_RESPONSE_TIME_PROP_NAME, TransportConstants.DEFAULT_HTTP_RESPONSE_TIME, configuration);
- httpKeepAliveTimer = new Timer(true);
+ httpKeepAliveTimer = new Timer();
httpKeepAliveTask = new HttpKeepAliveTask();
httpKeepAliveTimer.schedule(httpKeepAliveTask, httpServerScanPeriod, httpServerScanPeriod);
}
@@ -268,8 +268,9 @@
if(httpKeepAliveTimer != null)
{
+ httpKeepAliveTask.cancel();
+
httpKeepAliveTimer.cancel();
-
}
serverChannel.close().awaitUninterruptibly();
bossExecutor.shutdown();
More information about the jboss-cvs-commits
mailing list