diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/Transport.java b/activemq-core/src/main/java/org/apache/activemq/transport/Transport.java index f0a6ac6727..7f017ebf64 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/Transport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/Transport.java @@ -125,5 +125,11 @@ public interface Transport extends Service { * */ public String getRemoteAddress(); + + /** + * Indicates if the transport can handle faults + * @return tru if fault tolerant + */ + public boolean isFaultTolerant(); } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportFilter.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportFilter.java index fa3eea85f0..56c5fec86f 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportFilter.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportFilter.java @@ -114,4 +114,12 @@ public class TransportFilter implements TransportListener,Transport{ public String getRemoteAddress() { return next.getRemoteAddress(); } + + /** + * @return + * @see org.apache.activemq.transport.Transport#isFaultTolerant() + */ + public boolean isFaultTolerant(){ + return next.isFaultTolerant(); + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java index bcd99c87d4..ba07989d91 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java @@ -19,6 +19,7 @@ package org.apache.activemq.transport; import java.io.IOException; +import org.apache.activemq.command.MessageDispatch; import org.apache.activemq.util.ServiceSupport; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -103,5 +104,9 @@ public abstract class TransportSupport extends ServiceSupport implements Transpo throw new IOException("The transport is not running."); } } + + public boolean isFaultTolerant(){ + return false; + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java index 289669bd80..04a73b42fb 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java @@ -545,5 +545,9 @@ public class FailoverTransport implements CompositeTransport { } return null; } + + public boolean isFaultTolerant(){ + return true; + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java index 82f2466d6c..50b0a470e5 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java @@ -539,4 +539,9 @@ public class FanoutTransport implements CompositeTransport { transportListener.onCommand(command); } } + + + public boolean isFaultTolerant(){ + return true; + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/mock/MockTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/mock/MockTransport.java index a496d2693b..c85a221ed1 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/mock/MockTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/mock/MockTransport.java @@ -130,6 +130,13 @@ public class MockTransport extends DefaultTransportListener implements Transport public String getRemoteAddress() { return getNext().getRemoteAddress(); - } + } + + /** + * @see org.apache.activemq.transport.Transport#isFaultTolerant() + */ + public boolean isFaultTolerant(){ + return getNext().isFaultTolerant(); + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java index 1c875e9be5..1a6a1c4c1f 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java @@ -269,4 +269,8 @@ public class VMTransport implements Transport,Task{ } } } + + public boolean isFaultTolerant(){ + return false; + } }