qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1671335 - /qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
Date Sat, 04 Apr 2015 21:15:54 GMT
Author: kwall
Date: Sat Apr  4 21:15:54 2015
New Revision: 1671335

URL: http://svn.apache.org/r1671335
Log:
QPID-6429: [Java Broker] Make NetworkConnectionScheduler utilise the Broker's uncaught exception
handler so that exeptions are logged and can optionally stop the Broker

* Also bound the IO pool's upper size

Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java?rev=1671335&r1=1671334&r2=1671335&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
Sat Apr  4 21:15:54 2015
@@ -21,8 +21,11 @@
 package org.apache.qpid.server.transport;
 
 import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.slf4j.Logger;
@@ -33,7 +36,7 @@ class NetworkConnectionScheduler
     private static final Logger LOGGER = LoggerFactory.getLogger(NetworkConnectionScheduler.class);
 
     private final SelectorThread _selectorThread;
-    private final ScheduledThreadPoolExecutor _executor;
+    private final ThreadPoolExecutor _executor;
     private final AtomicInteger _running = new AtomicInteger();
     private final int _poolSize;
 
@@ -41,9 +44,11 @@ class NetworkConnectionScheduler
     {
         _selectorThread = selectorThread;
         _poolSize = Runtime.getRuntime().availableProcessors();
-        _executor = new ScheduledThreadPoolExecutor(_poolSize, new ThreadFactory()
+        _executor = new ThreadPoolExecutor(_poolSize, _poolSize, 0L, TimeUnit.MILLISECONDS,
+                                           new LinkedBlockingQueue<Runnable>(), new
ThreadFactory()
         {
             final AtomicInteger _count = new AtomicInteger();
+
             @Override
             public Thread newThread(final Runnable r)
             {
@@ -57,7 +62,7 @@ class NetworkConnectionScheduler
 
     public void schedule(final NonBlockingConnection connection)
     {
-        _executor.submit(new Runnable()
+        _executor.execute(new Runnable()
                         {
                             @Override
                             public void run()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message