[jboss-cvs] JBoss Messaging SVN: r2616 - trunk/src/main/org/jboss/jms/client/container.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 30 20:41:56 EDT 2007


Author: clebert.suconic at jboss.com
Date: 2007-04-30 20:41:56 -0400 (Mon, 30 Apr 2007)
New Revision: 2616

Modified:
   trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-946 - avoiding instanceOf clause

Modified: trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2007-05-01 00:23:13 UTC (rev 2615)
+++ trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2007-05-01 00:41:56 UTC (rev 2616)
@@ -33,7 +33,6 @@
 import javax.jms.ServerSessionPool;
 import javax.jms.Session;
 import javax.jms.TransactionInProgressException;
-import javax.jms.ServerSession;
 
 import org.jboss.aop.joinpoint.Invocation;
 import org.jboss.aop.joinpoint.MethodInvocation;
@@ -250,10 +249,10 @@
          state.getClientAckList().add(info);
       }
       // if XA and there is no transaction enlisted on XA we will act as AutoAcknowledge
-      // However if it's a MDB (or ServerSession) we should behaved as transacted
+      // However if it's a MDB (if there is a DistinguishedListener) we should behaved as transacted
       else if (ackMode == Session.AUTO_ACKNOWLEDGE ||
                (state.isXA() && (state.getCurrentTxId() instanceof LocalTx) &&
-                  !(state.getDistinguishedListener() instanceof ServerSession)))
+                  (state.getDistinguishedListener() == null)))
       {
          // We collect the single acknowledgement in the state. 
                            
@@ -309,10 +308,10 @@
       int ackMode = state.getAcknowledgeMode();
 
       // if XA and there is no transaction enlisted on XA we will act as AutoAcknowledge
-      // However if it's a MDB (or ServerSession) we should behaved as transacted
+      // However if it's a MDB (if there is a DistinguishedListener) we should behaved as transacted
       if (ackMode == Session.AUTO_ACKNOWLEDGE ||
          (state.isXA() && (state.getCurrentTxId() instanceof LocalTx) &&
-                  !(state.getDistinguishedListener() instanceof ServerSession)))
+                  (state.getDistinguishedListener() == null)))
       {
          // We auto acknowledge.
 




More information about the jboss-cvs-commits mailing list