summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-10-19 11:05:11 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-10-19 11:05:11 +0000
commit931b2c6497180d8d930e08cb06a6b9fb3e84aec8 (patch)
tree2c2f8cadb8ab4ef9597229d79c67a4d7f6c7c4c3
parenteeb8bfac548cc7c710555c01510c1e18fbb0175a (diff)
downloadqpid-python-931b2c6497180d8d930e08cb06a6b9fb3e84aec8.tar.gz
Merged revisions 573738-573739,573741-574077,574079-574236,574238-574265,574267-574503,574505-574554,574556-574584,574586-574873,574875-574901,574903-575737,575739-575787,575789-575810,575812-577772,577774-577940,577942-578057,578059-578732,578734,578736-578744,578746-578827,578829-578844,578846-579114,579116-579146,579148-579197,579199-579228,579230-579573,579575-579576,579579-579601,579603-579613,579615-579708,579710-580021,580023-580039,580042-580060,580062-580065,580067-580080,580082-580257,580259-580264,580266-580350,580352-580984,580986-580991,580994-581001,581003-581170,581172-581188,581190-581206,581208-581245,581247-581292,581294-581539,581541-581565,581567-581620,581622-581626,581628-581646,581648-581967,581969-582197,582199-582200,582203-582204,582206-582262,582264,582267-583084,583087,583089-583104,583106-583146,583148-583153,583155-583169,583171-583172,583174-583398,583400-583414,583416-583417,583419-583437,583439-583482,583484-583517,583519-583545,583547,583549-583774,583777-583807,583809-583881,583883-584107,584109-584112,584114-584123,584125-585564,585566-585569,585571-585574,585576-585641,585643-585905,585907-585911,585913-586343,586345-586374 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1 ........ r586374 | ritchiem | 2007-10-19 12:01:40 +0100 (Fri, 19 Oct 2007) | 1 line QPID-654 : added a shutdownNow() call if the _taskPool hasn't terminiated by the time we have finished closing. ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@586376 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQConnection.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
index 07b8d8d9b7..9abc94b3df 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
@@ -300,7 +300,7 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
//We need to change protocol handler here as an error during the connect will not
// cause the StateManager to be replaced. So the state is out of sync on reconnect
// This can be seen when a exception occurs during connection. i.e. log4j NoSuchMethod. (using < 1.2.12)
- _protocolHandler.setStateManager(new AMQStateManager());
+ _protocolHandler.setStateManager(new AMQStateManager());
if (_logger.isInfoEnabled())
{
@@ -809,6 +809,16 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
_protocolHandler.closeConnection(timeout);
+ //If the taskpool hasn't shutdown by now then give it shutdownNow.
+ // This will interupt any running tasks.
+ if (!_taskPool.isTerminated())
+ {
+ List<Runnable> tasks = _taskPool.shutdownNow();
+ for (Runnable r : tasks)
+ {
+ _logger.warn("Connection close forced taskpool to prevent execution:" + r);
+ }
+ }
}
catch (AMQException e)
{