[jboss-cvs] JBoss Messaging SVN: r8498 - in branches/Branch_1_4/src/main/org/jboss/jms/client: remoting and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 9 05:51:08 EST 2012
Author: gaohoward
Date: 2012-02-09 05:51:07 -0500 (Thu, 09 Feb 2012)
New Revision: 8498
Modified:
branches/Branch_1_4/src/main/org/jboss/jms/client/container/ConnectionAspect.java
branches/Branch_1_4/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java
Log:
JBMESSAGING-1912
Modified: branches/Branch_1_4/src/main/org/jboss/jms/client/container/ConnectionAspect.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/client/container/ConnectionAspect.java 2012-01-25 11:22:45 UTC (rev 8497)
+++ branches/Branch_1_4/src/main/org/jboss/jms/client/container/ConnectionAspect.java 2012-02-09 10:51:07 UTC (rev 8498)
@@ -178,15 +178,18 @@
JMSRemotingConnection remotingConnection = state.getRemotingConnection();
- // remove the consolidated remoting connection listener
-
- ConsolidatedRemotingConnectionListener l = remotingConnection.removeConnectionListener();
- if (l != null)
- {
- l.clear();
- }
-
- // Finished with the connection - we need to shutdown callback server
+ // remove the consolidated remoting connection listener
+ ConsolidatedRemotingConnectionListener l = remotingConnection.removeConnectionListener();
+
+ if (l != null)
+ {
+ if (l.setBeingHandled())
+ {
+ l.clear();
+ }
+ }
+
+ // Finished with the connection - we need to shutdown callback server
remotingConnection.stop();
// And to resource manager
Modified: branches/Branch_1_4/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java 2012-01-25 11:22:45 UTC (rev 8497)
+++ branches/Branch_1_4/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java 2012-02-09 10:51:07 UTC (rev 8498)
@@ -49,6 +49,10 @@
private Object jmsExceptionLock = new Object();
+ private Object exceptionLock = new Object();
+
+ private boolean beingHandled = false;
+
// Constructors ---------------------------------------------------------------------------------
public ConsolidatedRemotingConnectionListener()
@@ -65,6 +69,12 @@
{
return;
}
+
+ //if the connection is already closed then there is no point handling it again.
+ if (!setBeingHandled())
+ {
+ return;
+ }
// forward the exception to delegate listener and JMS ExceptionListeners;
boolean forwardToJMSListener = true;
@@ -186,6 +196,20 @@
remotingListener = null;
log.trace(this + " cleared");
}
+
+ //https://issues.jboss.org/browse/JBMESSAGING-1912
+ public boolean setBeingHandled()
+ {
+ synchronized (exceptionLock)
+ {
+ if (beingHandled)
+ {
+ return false;
+ }
+ beingHandled = true;
+ return true;
+ }
+ }
private void clearJmsExceptionListener()
{
More information about the jboss-cvs-commits
mailing list