summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2006-12-13 12:38:51 +0000
committerMartin Ritchie <ritchiem@apache.org>2006-12-13 12:38:51 +0000
commit907e4996607e8fca90815b31b8f3934af8730458 (patch)
tree1ea49bbaa4ea73af0619081b20c2666fc809656b /java
parent7d8ae2a2b299597020913d41923df8ba35f74b37 (diff)
downloadqpid-python-907e4996607e8fca90815b31b8f3934af8730458.tar.gz
QPID-172
Applied the same change to the second call to <threadpool>.execute() to be sure that a RejectedExecutionException doesn't appear. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@486626 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java b/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
index 2ace2b8348..38cfa68c78 100644
--- a/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
+++ b/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
@@ -58,6 +58,9 @@ public class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionH
Job job = getJobForSession(session);
job.acquire(); //prevents this job being removed from _jobs
job.add(event);
+
+ //Additional checks on pool to check that it hasn't shutdown.
+ // The alternative is to catch the RejectedExecutionException that will result from executing on a shutdown pool
if (job.activate() && _poolReference.getPool() != null && !_poolReference.getPool().isShutdown())
{
_poolReference.getPool().execute(job);
@@ -100,7 +103,9 @@ public class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionH
}
else
{
- if (job.activate())
+ // ritchiem : 2006-12-13 Do we need to perform the additional checks here?
+ // Can the pool be shutdown at this point?
+ if (job.activate() && _poolReference.getPool() != null && !_poolReference.getPool().isShutdown())
{
_poolReference.getPool().execute(job);
}
@@ -184,3 +189,4 @@ public class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionH
_poolReference.releaseExecutorService();
}
}
+