mirror of https://github.com/apache/activemq.git
Added flag to transport to denote if its fault tolerant
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@552736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f1240b2e72
commit
c7469c433c
|
@ -126,4 +126,10 @@ public interface Transport extends Service {
|
|||
*/
|
||||
public String getRemoteAddress();
|
||||
|
||||
/**
|
||||
* Indicates if the transport can handle faults
|
||||
* @return tru if fault tolerant
|
||||
*/
|
||||
public boolean isFaultTolerant();
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -104,4 +105,8 @@ public abstract class TransportSupport extends ServiceSupport implements Transpo
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isFaultTolerant(){
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -546,4 +546,8 @@ public class FailoverTransport implements CompositeTransport {
|
|||
return null;
|
||||
}
|
||||
|
||||
public boolean isFaultTolerant(){
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -539,4 +539,9 @@ public class FanoutTransport implements CompositeTransport {
|
|||
transportListener.onCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean isFaultTolerant(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,4 +132,11 @@ public class MockTransport extends DefaultTransportListener implements Transport
|
|||
return getNext().getRemoteAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.activemq.transport.Transport#isFaultTolerant()
|
||||
*/
|
||||
public boolean isFaultTolerant(){
|
||||
return getNext().isFaultTolerant();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -269,4 +269,8 @@ public class VMTransport implements Transport,Task{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFaultTolerant(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue