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
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -545,5 +545,9 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -269,4 +269,8 @@ public class VMTransport implements Transport,Task{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFaultTolerant(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue