diff options
Diffstat (limited to 'qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java')
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java b/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java index d033a49f5c..1ef71eccba 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java @@ -20,11 +20,12 @@ */ package org.apache.qpid.jms.failover; -import org.apache.qpid.jms.BrokerDetails; -import org.apache.qpid.jms.ConnectionURL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.qpid.jms.BrokerDetails; +import org.apache.qpid.jms.ConnectionURL; + public class FailoverSingleServer implements FailoverMethod { private static final Logger _logger = LoggerFactory.getLogger(FailoverSingleServer.class); @@ -36,10 +37,10 @@ public class FailoverSingleServer implements FailoverMethod private BrokerDetails _brokerDetail; /** The number of times to retry connecting to the sever */ - protected int _retries; + private int _retries; /** The current number of attempts made to the server */ - protected int _currentRetries = 0; + private int _currentRetries = 0; public FailoverSingleServer(ConnectionURL connectionDetails) @@ -64,6 +65,11 @@ public class FailoverSingleServer implements FailoverMethod _currentRetries = 0; } + protected void setCurrentRetries(int currentRetries) + { + _currentRetries = currentRetries; + } + public boolean failoverAllowed() { return _currentRetries < _retries; @@ -150,6 +156,11 @@ public class FailoverSingleServer implements FailoverMethod _retries = retries; } + public int getRetries() + { + return _retries; + } + public String methodName() { return "Single Server"; |