[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] jbossmq/src/main/org/jboss/mq SpyConnection.java SpyXAConnection.java
From:       Adrian Brock <ejort () users ! sourceforge ! net>
Date:       2004-02-28 19:05:00
Message-ID: E1Ax9lk-0001F4-JV () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

  User: ejort   
  Date: 04/02/28 11:05:00

  Modified:    src/main/org/jboss/mq SpyConnection.java
                        SpyXAConnection.java
  Log:
  Set the correct acknowledgement mode for transacted sessions
  
  Revision  Changes    Path
  1.14      +7 -1      jbossmq/src/main/org/jboss/mq/SpyConnection.java
  
  Index: SpyConnection.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/SpyConnection.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SpyConnection.java	8 Dec 2003 15:02:53 -0000	1.13
  +++ SpyConnection.java	28 Feb 2004 19:05:00 -0000	1.14
  @@ -30,7 +30,7 @@
    * @author Norbert Lataille (Norbert.Lataille@m4x.org)
    * @author Hiram Chirino (Cojonudo14@hotmail.com)
    * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
  - * @version $Revision: 1.13 $
  + * @version $Revision: 1.14 $
    */
   public class SpyConnection extends Connection implements Serializable, \
TopicConnection, QueueConnection  {
  @@ -88,6 +88,8 @@
            throw new IllegalStateException("The connection is closed");
         checkClientID();
   
  +      if (transacted)
  +         acknowledgeMode = Session.SESSION_TRANSACTED;
         Session session = new SpySession(this, transacted, acknowledgeMode, false);
   
         //add the new session to the createdSessions list
  @@ -107,6 +109,8 @@
            throw new IllegalStateException("The connection is closed");
         checkClientID();
   
  +      if (transacted)
  +         acknowledgeMode = Session.SESSION_TRANSACTED;
         TopicSession session = new SpyTopicSession(this, transacted, \
acknowledgeMode);  
         //add the new session to the createdSessions list
  @@ -170,6 +174,8 @@
            throw new IllegalStateException("The connection is closed");
         checkClientID();
   
  +      if (transacted)
  +         acknowledgeMode = Session.SESSION_TRANSACTED;
         QueueSession session = new SpyQueueSession(this, transacted, \
acknowledgeMode);  
         //add the new session to the createdSessions list
  
  
  
  1.11      +14 -4     jbossmq/src/main/org/jboss/mq/SpyXAConnection.java
  
  Index: SpyXAConnection.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/SpyXAConnection.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SpyXAConnection.java	8 Dec 2003 15:02:53 -0000	1.10
  +++ SpyXAConnection.java	28 Feb 2004 19:05:00 -0000	1.11
  @@ -24,7 +24,7 @@
    * 
    * @author Hiram Chirino (Cojonudo14@hotmail.com)
    * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
  - * @version $Revision: 1.10 $
  + * @version $Revision: 1.11 $
    */
   public class SpyXAConnection extends SpyConnection implements Serializable, \
XAConnection, XATopicConnection, XAQueueConnection  {
  @@ -86,7 +86,17 @@
   
      public XASession createXASession() throws JMSException
      {
  -      return createXATopicSession();
  +      if (closed)
  +         throw new IllegalStateException("The connection is closed");
  +      checkClientID();
  +
  +      XASession session = new SpySession(this, true, Session.SESSION_TRANSACTED, \
true);  +      //add the new session to the createdSessions list
  +      synchronized (createdSessions)
  +      {
  +         createdSessions.add(session);
  +      }
  +      return session;
      }
   
      public XAQueueSession createXAQueueSession() throws JMSException
  @@ -95,7 +105,7 @@
            throw new IllegalStateException("The connection is closed");
         checkClientID();
   
  -      XAQueueSession session = new SpyQueueSession(this, true, 0, true);
  +      XAQueueSession session = new SpyQueueSession(this, true, \
Session.SESSION_TRANSACTED, true);  
         //add the new session to the createdSessions list
         synchronized (createdSessions)
  @@ -112,7 +122,7 @@
            throw new IllegalStateException("The connection is closed");
         checkClientID();
   
  -      XATopicSession session = new SpyTopicSession(this, true, 0, true);
  +      XATopicSession session = new SpyTopicSession(this, true, \
Session.SESSION_TRANSACTED, true);  //add the new session to the createdSessions list
         synchronized (createdSessions)
         {
  
  
  


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic