commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wer...@apache.org
Subject cvs commit: jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger DefaultMessenger.java
Date Tue, 16 Sep 2003 22:39:59 GMT
werken      2003/09/16 15:39:59

  Modified:    messenger project.xml
               messenger/src/java/org/apache/commons/messenger
                        DefaultMessenger.java
  Log:
  synchronized block added to prevent race condition between the test and
  set of the consumer on the messenger.  problem exascerbated by spiritsoft's
  p2p jms impl for some reason.
  
  Revision  Changes    Path
  1.17      +1 -1      jakarta-commons-sandbox/messenger/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/project.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- project.xml	27 Aug 2003 16:23:40 -0000	1.16
  +++ project.xml	16 Sep 2003 22:39:58 -0000	1.17
  @@ -4,7 +4,7 @@
     <pomVersion>3</pomVersion>
     <name>commons-messenger</name>
     <id>commons-messenger</id>
  -  <currentVersion>1.0-dev-13</currentVersion>
  +  <currentVersion>1.0-dev-14</currentVersion>
     <organization>
   	  <name>Apache Software Foundation</name>
   	  <url>http://www.apache.org</url>
  
  
  
  1.21      +6 -4      jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/DefaultMessenger.java
  
  Index: DefaultMessenger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/DefaultMessenger.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- DefaultMessenger.java	9 Sep 2003 10:48:37 -0000	1.20
  +++ DefaultMessenger.java	16 Sep 2003 22:39:58 -0000	1.21
  @@ -236,9 +236,11 @@
       protected MessageConsumer getReplyToConsumer() throws JMSException {
           MessengerSession messengerSession = getMessengerSession();
           MessageConsumer consumer = messengerSession.getReplyToConsumer();
  -        if (consumer == null) {
  -            consumer = createMessageConsumer(messengerSession, messengerSession.getSession(),
messengerSession.getReplyToDestination());
  -            messengerSession.setReplyToConsumer(consumer);
  +        synchronized ( messengerSession ) {
  +            if (consumer == null) {
  +                consumer = createMessageConsumer(messengerSession, messengerSession.getSession(),
messengerSession.getReplyToDestination());
  +                messengerSession.setReplyToConsumer(consumer);
  +            }
           }
           return consumer;
       }
  
  
  

Mime
View raw message