diff options
Diffstat (limited to 'java/common/src')
| -rw-r--r-- | java/common/src/main/java/org/apache/qpidity/transport/Session.java | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/java/common/src/main/java/org/apache/qpidity/transport/Session.java b/java/common/src/main/java/org/apache/qpidity/transport/Session.java index bf16a6c0d8..5a8a92fcf4 100644 --- a/java/common/src/main/java/org/apache/qpidity/transport/Session.java +++ b/java/common/src/main/java/org/apache/qpidity/transport/Session.java @@ -41,17 +41,17 @@ import java.util.concurrent.atomic.AtomicBoolean; public class Session extends Invoker { - static + static { - String enableReplay = "enable_replay"; - try - { - ENABLE_REPLAY = new Boolean(System.getProperties().getProperty(enableReplay, "false")); - } - catch (Exception e) - { - ENABLE_REPLAY = false; - } + String enableReplay = "enable_command_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); @@ -190,8 +190,6 @@ public class Session extends Invoker 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++) @@ -201,7 +199,6 @@ public class Session extends Invoker commands.notifyAll(); log.debug("%s commands remaining: %s", this, commands); } - } } void complete(long mark) @@ -220,10 +217,9 @@ public class Session extends Invoker { synchronized (commands) { - if(ENABLE_REPLAY) - { - commands.put(commandsOut++, m); - } + // You only need to keep the command if you need command level replay. + // If not we only need to keep track of commands to make sync work + commands.put(commandsOut++,(ENABLE_REPLAY?m:null)); channel.method(m); } } |
