qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r599030 - /incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java
Date Wed, 28 Nov 2007 15:38:17 GMT
Author: arnaudsimon
Date: Wed Nov 28 07:38:17 2007
New Revision: 599030

URL: http://svn.apache.org/viewvc?rev=599030&view=rev
Log:
added enable_replay option

Modified:
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java?rev=599030&r1=599029&r2=599030&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/Session.java
Wed Nov 28 07:38:17 2007
@@ -41,7 +41,19 @@
 
 public class Session extends Invoker
 {
-
+      static
+    {
+        String enableReplay = "enable_replay";
+            try
+            {
+                ENABLE_REPLAY  = new Boolean(System.getProperties().getProperty(enableReplay,
"false"));
+            }
+            catch (Exception e)
+            {
+                ENABLE_REPLAY = false;
+            }
+    }
+    private static boolean ENABLE_REPLAY = false;
     private static final Logger log = Logger.get(Session.class);
 
     // channel may be null
@@ -178,17 +190,18 @@
     void complete(long lower, long upper)
     {
         log.debug("%s complete(%d, %d)", this, lower, upper);
-
+        if( ENABLE_REPLAY )
+        {
         synchronized (commands)
         {
             for (long id = lower; id <= upper; id++)
             {
                 commands.remove(id);
             }
-
             commands.notifyAll();
             log.debug("%s   commands remaining: %s", this, commands);
         }
+        }
     }
 
     void complete(long mark)
@@ -207,7 +220,10 @@
         {
             synchronized (commands)
             {
-                commands.put(commandsOut++, m);
+                if(ENABLE_REPLAY)
+                {
+                     commands.put(commandsOut++, m);
+                }
                 channel.method(m);
             }
         }



Mime
View raw message