summaryrefslogtreecommitdiff
path: root/qpid/java/common/src
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
commitb8e0894da390c8ccaaf6bbad2b9ec834c232a3d5 (patch)
tree7d1c402c87aea95d4b1589069fef6041b55aca45 /qpid/java/common/src
parentf1ee8107acf13c20fcacf53546e044f472adc1d0 (diff)
downloadqpid-python-b8e0894da390c8ccaaf6bbad2b9ec834c232a3d5.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@486626 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/src')
-rw-r--r--qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java b/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
index 2ace2b8348..38cfa68c78 100644
--- a/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
+++ b/qpid/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();
}
}
+