summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2015-03-17 21:13:42 +0000
committerRobert Godfrey <rgodfrey@apache.org>2015-03-17 21:13:42 +0000
commite717efdc1f178792d05b3e7eedb509e950de35d9 (patch)
tree4afdbc1ad2906c24d2701866dbe995ed0e7b5083 /qpid/java
parent04975bff0a82da456ac7575a2eaa7d7113a7ca83 (diff)
downloadqpid-python-e717efdc1f178792d05b3e7eedb509e950de35d9.tar.gz
QPID-6429 : Remove dead code, add name to (idle) pooled IO threads
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1667404 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java68
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java14
2 files changed, 13 insertions, 69 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
index 1485b3df5c..852f512ca6 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
@@ -2417,74 +2417,6 @@ public abstract class AbstractConfiguredObject<X extends ConfiguredObject<X>> im
}
}
- private static class CloseResult implements FutureResult
- {
- private volatile FutureResult _childFutureResult;
-
- @Override
- public boolean isComplete()
- {
- return _childFutureResult != null && _childFutureResult.isComplete();
- }
-
- @Override
- public void waitForCompletion()
- {
- synchronized (this)
- {
- while (_childFutureResult == null)
- {
- try
- {
- wait();
- }
- catch (InterruptedException e)
- {
-
- }
- }
- }
- _childFutureResult.waitForCompletion();
-
- }
-
- @Override
- public void waitForCompletion(final long timeout) throws TimeoutException
- {
- long startTime = System.currentTimeMillis();
- long remaining = timeout;
-
- synchronized (this)
- {
- while (_childFutureResult == null && remaining > 0)
- {
- try
- {
- wait(remaining);
- }
- catch (InterruptedException e)
- {
-
- }
- remaining = startTime + timeout - System.currentTimeMillis();
-
- if(remaining <= 0)
- {
- throw new TimeoutException("Completion did not occur within given timeout: " + timeout);
- }
- }
- }
- _childFutureResult.waitForCompletion(remaining);
-
- }
-
- public synchronized void setChildFutureResult(final FutureResult childFutureResult)
- {
- _childFutureResult = childFutureResult;
- notifyAll();
- }
- }
-
private static class AttributeGettingHandler implements InvocationHandler
{
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
index 36fd63c360..8e6e4b7914 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NetworkConnectionScheduler.java
@@ -20,7 +20,9 @@
*/
package org.apache.qpid.server.transport;
+import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
import org.slf4j.Logger;
@@ -39,7 +41,17 @@ class NetworkConnectionScheduler
{
_selectorThread = selectorThread;
_poolSize = Runtime.getRuntime().availableProcessors();
- _executor = new ScheduledThreadPoolExecutor(_poolSize);
+ _executor = new ScheduledThreadPoolExecutor(_poolSize, new ThreadFactory()
+ {
+ final AtomicInteger _count = new AtomicInteger();
+ @Override
+ public Thread newThread(final Runnable r)
+ {
+ Thread t = Executors.defaultThreadFactory().newThread(r);
+ t.setName("IO-pool-"+selectorThread.getName()+"-"+_count.incrementAndGet());
+ return t;
+ }
+ });
_executor.prestartAllCoreThreads();
}