Package org.apache.activemq.transport
Class TransportSupport
java.lang.Object
org.apache.activemq.util.ServiceSupport
org.apache.activemq.transport.TransportSupport
- Direct Known Subclasses:
TransportThreadSupport
A useful base class for transport implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasyncRequest(Object command, ResponseCallback responseCallback) An asynchronous request response where the Receipt will be returned in the future.protected voidvoidProcess the inbound commandReturns the current transport listenerbooleanbooleanbooleanIndicates if the transport can handle faultsbooleanboolean<T> Tnarrow acceptancevoidPasses any IO exceptions into the transport listenervoidreconnect to another locationA synchronous request responseA synchronous request responsevoidsetTransportListener(TransportListener commandListener) Registers an inbound command listenervoidupdateURIs(boolean reblance, URI[] uris) Provide a list of available alternative locationsMethods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, doStart, doStop, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.transport.Transport
getPeerCertificates, getReceiveCounter, getRemoteAddress, getWireFormat, oneway, setPeerCertificates
-
Constructor Details
-
TransportSupport
public TransportSupport()
-
-
Method Details
-
getTransportListener
Returns the current transport listener- Specified by:
getTransportListenerin interfaceTransport- Returns:
-
setTransportListener
Registers an inbound command listener- Specified by:
setTransportListenerin interfaceTransport- Parameters:
commandListener-
-
narrow
narrow acceptance -
asyncRequest
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException Description copied from interface:TransportAn asynchronous request response where the Receipt will be returned in the future. If responseCallback is not null, then it will be called when the response has been completed.- Specified by:
asyncRequestin interfaceTransportresponseCallback- TODO- Returns:
- the FutureResponse
- Throws:
IOException
-
request
Description copied from interface:TransportA synchronous request response- Specified by:
requestin interfaceTransport- Returns:
- the response
- Throws:
IOException
-
request
Description copied from interface:TransportA synchronous request response- Specified by:
requestin interfaceTransport- Returns:
- the repsonse or null if timeout
- Throws:
IOException
-
doConsume
Process the inbound command -
onException
Passes any IO exceptions into the transport listener -
checkStarted
- Throws:
IOException
-
isFaultTolerant
public boolean isFaultTolerant()Description copied from interface:TransportIndicates if the transport can handle faults- Specified by:
isFaultTolerantin interfaceTransport- Returns:
- true if fault tolerant
-
reconnect
Description copied from interface:Transportreconnect to another location- Specified by:
reconnectin interfaceTransport- Throws:
IOException- on failure of if not supported
-
isReconnectSupported
public boolean isReconnectSupported()- Specified by:
isReconnectSupportedin interfaceTransport- Returns:
- true if reconnect is supported
-
isUpdateURIsSupported
public boolean isUpdateURIsSupported()- Specified by:
isUpdateURIsSupportedin interfaceTransport- Returns:
- true if updating uris is supported
-
updateURIs
Description copied from interface:TransportProvide a list of available alternative locations- Specified by:
updateURIsin interfaceTransport- Throws:
IOException
-
isDisposed
public boolean isDisposed()- Specified by:
isDisposedin interfaceTransport- Returns:
- true if the transport is disposed
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceTransport- Returns:
- true if the transport is connected
-