Author: ritchiem
Date: Wed Dec 13 04:38:51 2006
New Revision: 486626
URL: http://svn.apache.org/viewvc?view=rev&rev=486626
Log:
QPID-172
Applied the same change to the second call to <threadpool>.execute() to be sure
that a RejectedExecutionException doesn't appear.
Modified:
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
Modified:
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java?view=diff&rev=486626&r1=486625&r2=486626
==============================================================================
---
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
(original)
+++
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
Wed Dec 13 04:38:51 2006
@@ -58,6 +58,9 @@
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 @@
}
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 @@
_poolReference.releaseExecutorService();
}
}
+