activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [3/4] activemq git commit: https://issues.apache.org/jira/browse/AMQ-5535 - allow close state reporting w/o contention
Date Fri, 23 Jan 2015 13:09:39 GMT
https://issues.apache.org/jira/browse/AMQ-5535 - allow close state reporting w/o contention


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/de549f89
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/de549f89
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/de549f89

Branch: refs/heads/trunk
Commit: de549f8926988ab436084225cdcd6595f1657262
Parents: c9c1f58
Author: gtully <gary.tully@gmail.com>
Authored: Fri Jan 23 12:23:34 2015 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Fri Jan 23 12:23:34 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/ActiveMQConnection.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/de549f89/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
index ed0dd47..aef8513 100755
--- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
+++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java
@@ -2550,6 +2550,10 @@ public class ActiveMQConnection implements Connection, TopicConnection,
QueueCon
     protected Scheduler getScheduler() throws JMSException {
         Scheduler result = scheduler;
         if (result == null) {
+            if (isClosing() || isClosed()) {
+                // without lock contention report the closing state
+                throw new ConnectionClosedException();
+            }
             synchronized (this) {
                 result = scheduler;
                 if (result == null) {


Mime
View raw message