public class FailoverTransport extends Object implements CompositeTransport
Constructor and Description |
---|
FailoverTransport() |
Modifier and Type | Method and Description |
---|---|
void |
add(boolean rebalance,
String u) |
void |
add(boolean rebalance,
URI[] u) |
FutureResponse |
asyncRequest(Object command,
ResponseCallback responseCallback)
An asynchronous request response where the Receipt will be returned in
the future.
|
void |
connectionInterruptProcessingComplete(ConnectionId connectionId) |
void |
disposeTransport(Transport transport) |
int |
getBackupPoolSize() |
Transport |
getConnectedTransport() |
URI |
getConnectedTransportURI() |
int |
getConnectFailures() |
int |
getCurrentBackups() |
long |
getInitialReconnectDelay() |
int |
getMaxCacheSize() |
int |
getMaxReconnectAttempts() |
long |
getMaxReconnectDelay() |
int |
getReceiveCounter()
Returns a counter which gets incremented as data is read from the transport.
|
long |
getReconnectDelay() |
double |
getReconnectDelayExponent() |
String |
getRemoteAddress() |
int |
getStartupMaxReconnectAttempts() |
ConnectionStateTracker |
getStateTracker() |
long |
getTimeout() |
TransportListener |
getTransportListener()
Returns the current transport listener
|
String |
getUpdateURIsURL() |
int |
getWarnAfterReconnectAttempts() |
void |
handleConnectionControl(ConnectionControl control) |
void |
handleTransportFailure(IOException e) |
void |
handleTransportFailure(Transport failed,
IOException e) |
boolean |
isBackup() |
boolean |
isConnected() |
boolean |
isDisposed() |
boolean |
isFaultTolerant()
Indicates if the transport can handle faults
|
protected boolean |
isPriority(URI uri) |
boolean |
isPriorityBackup() |
boolean |
isRandomize() |
boolean |
isRebalanceUpdateURIs() |
boolean |
isReconnectSupported() |
boolean |
isTrackMessages() |
boolean |
isTrackTransactionProducers() |
boolean |
isUpdateURIsSupported() |
boolean |
isUseExponentialBackOff() |
<T> T |
narrow(Class<T> target) |
void |
oneway(Object o)
A one way asynchronous send
|
void |
reconnect(boolean rebalance) |
void |
reconnect(URI uri)
reconnect to another location
|
void |
remove(boolean rebalance,
URI[] u) |
Object |
request(Object command)
A synchronous request response
|
Object |
request(Object command,
int timeout)
A synchronous request response
|
protected void |
restoreTransport(Transport t) |
void |
setBackup(boolean backup) |
void |
setBackupPoolSize(int backupPoolSize) |
void |
setInitialReconnectDelay(long initialReconnectDelay) |
void |
setMaxCacheSize(int maxCacheSize) |
void |
setMaxReconnectAttempts(int maxReconnectAttempts) |
void |
setMaxReconnectDelay(long maxReconnectDelay) |
void |
setNestedExtraQueryOptions(String nestedExtraQueryOptions) |
void |
setPriorityBackup(boolean priorityBackup) |
void |
setPriorityURIs(String priorityURIs) |
void |
setRandomize(boolean randomize) |
void |
setRebalanceUpdateURIs(boolean rebalanceUpdateURIs) |
void |
setReconnectDelay(long reconnectDelay) |
void |
setReconnectDelayExponent(double reconnectDelayExponent) |
void |
setReconnectSupported(boolean value) |
void |
setStartupMaxReconnectAttempts(int startupMaxReconnectAttempts) |
void |
setTimeout(long timeout) |
void |
setTrackMessages(boolean trackMessages) |
void |
setTrackTransactionProducers(boolean trackTransactionProducers) |
void |
setTransportListener(TransportListener commandListener)
Registers an inbound command listener
|
void |
setUpdateURIsSupported(boolean value) |
void |
setUpdateURIsURL(String updateURIsURL) |
void |
setUseExponentialBackOff(boolean useExponentialBackOff) |
void |
setWarnAfterReconnectAttempts(int warnAfterReconnectAttempts)
Sets the number of Connect / Reconnect attempts that must occur before a warn message
is logged indicating that the transport is not connected.
|
void |
start() |
void |
stop() |
String |
toString() |
void |
updateURIs(boolean rebalance,
URI[] updatedURIs)
Provide a list of available alternative locations
|
public FailoverTransport()
public final void disposeTransport(Transport transport)
public final void handleTransportFailure(IOException e) throws InterruptedException
InterruptedException
public final void handleTransportFailure(Transport failed, IOException e) throws InterruptedException
InterruptedException
public final void handleConnectionControl(ConnectionControl control)
public long getInitialReconnectDelay()
public void setInitialReconnectDelay(long initialReconnectDelay)
public long getMaxReconnectDelay()
public void setMaxReconnectDelay(long maxReconnectDelay)
public long getReconnectDelay()
public void setReconnectDelay(long reconnectDelay)
public double getReconnectDelayExponent()
public void setReconnectDelayExponent(double reconnectDelayExponent)
public Transport getConnectedTransport()
public URI getConnectedTransportURI()
public int getMaxReconnectAttempts()
public void setMaxReconnectAttempts(int maxReconnectAttempts)
public int getStartupMaxReconnectAttempts()
public void setStartupMaxReconnectAttempts(int startupMaxReconnectAttempts)
public long getTimeout()
public void setTimeout(long timeout)
public boolean isRandomize()
public void setRandomize(boolean randomize)
randomize
- The randomize to set.public boolean isBackup()
public void setBackup(boolean backup)
public int getBackupPoolSize()
public void setBackupPoolSize(int backupPoolSize)
public int getCurrentBackups()
public boolean isTrackMessages()
public void setTrackMessages(boolean trackMessages)
public boolean isTrackTransactionProducers()
public void setTrackTransactionProducers(boolean trackTransactionProducers)
public int getMaxCacheSize()
public void setMaxCacheSize(int maxCacheSize)
public boolean isPriorityBackup()
public void setPriorityBackup(boolean priorityBackup)
public void setPriorityURIs(String priorityURIs)
public void oneway(Object o) throws IOException
Transport
oneway
in interface Transport
IOException
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException
Transport
asyncRequest
in interface Transport
responseCallback
- TODOIOException
public Object request(Object command) throws IOException
Transport
request
in interface Transport
IOException
public Object request(Object command, int timeout) throws IOException
Transport
request
in interface Transport
IOException
public void add(boolean rebalance, URI[] u)
add
in interface CompositeTransport
public void remove(boolean rebalance, URI[] u)
remove
in interface CompositeTransport
public void reconnect(boolean rebalance)
public TransportListener getTransportListener()
Transport
getTransportListener
in interface Transport
public void setTransportListener(TransportListener commandListener)
Transport
setTransportListener
in interface Transport
protected void restoreTransport(Transport t) throws Exception, IOException
Exception
IOException
public boolean isUseExponentialBackOff()
public void setUseExponentialBackOff(boolean useExponentialBackOff)
public String getRemoteAddress()
getRemoteAddress
in interface Transport
public boolean isFaultTolerant()
Transport
isFaultTolerant
in interface Transport
protected boolean isPriority(URI uri)
public boolean isDisposed()
isDisposed
in interface Transport
public boolean isConnected()
isConnected
in interface Transport
public void reconnect(URI uri) throws IOException
Transport
reconnect
in interface Transport
IOException
- on failure of if not supportedpublic boolean isReconnectSupported()
isReconnectSupported
in interface Transport
public void setReconnectSupported(boolean value)
public boolean isUpdateURIsSupported()
isUpdateURIsSupported
in interface Transport
public void setUpdateURIsSupported(boolean value)
public void updateURIs(boolean rebalance, URI[] updatedURIs) throws IOException
Transport
updateURIs
in interface Transport
IOException
public String getUpdateURIsURL()
public void setUpdateURIsURL(String updateURIsURL)
updateURIsURL
- the updateURIsURL to setpublic boolean isRebalanceUpdateURIs()
public void setRebalanceUpdateURIs(boolean rebalanceUpdateURIs)
rebalanceUpdateURIs
- the rebalanceUpdateURIs to setpublic int getReceiveCounter()
Transport
getReceiveCounter
in interface Transport
public int getConnectFailures()
public void connectionInterruptProcessingComplete(ConnectionId connectionId)
public ConnectionStateTracker getStateTracker()
public void setNestedExtraQueryOptions(String nestedExtraQueryOptions)
public int getWarnAfterReconnectAttempts()
public void setWarnAfterReconnectAttempts(int warnAfterReconnectAttempts)
warnAfterReconnectAttempts
- The number of failed connection attempts that must happen before a warning is logged.Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.