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
-
Method Summary
Modifier and TypeMethodDescriptionasyncRequest
(Object command, ResponseCallback responseCallback) An asynchronous request response where the Receipt will be returned in the future.protected void
void
Process the inbound commandReturns the current transport listenerboolean
boolean
boolean
Indicates if the transport can handle faultsboolean
boolean
<T> T
narrow acceptancevoid
Passes any IO exceptions into the transport listenervoid
reconnect to another locationA synchronous request responseA synchronous request responsevoid
setTransportListener
(TransportListener commandListener) Registers an inbound command listenervoid
updateURIs
(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, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getTransportListener
in interfaceTransport
- Returns:
-
setTransportListener
Registers an inbound command listener- Specified by:
setTransportListener
in interfaceTransport
- Parameters:
commandListener
-
-
narrow
narrow acceptance -
asyncRequest
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException Description copied from interface:Transport
An 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:
asyncRequest
in interfaceTransport
responseCallback
- TODO- Returns:
- the FutureResponse
- Throws:
IOException
-
request
Description copied from interface:Transport
A synchronous request response- Specified by:
request
in interfaceTransport
- Returns:
- the response
- Throws:
IOException
-
request
Description copied from interface:Transport
A synchronous request response- Specified by:
request
in 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:Transport
Indicates if the transport can handle faults- Specified by:
isFaultTolerant
in interfaceTransport
- Returns:
- true if fault tolerant
-
reconnect
Description copied from interface:Transport
reconnect to another location- Specified by:
reconnect
in interfaceTransport
- Throws:
IOException
- on failure of if not supported
-
isReconnectSupported
public boolean isReconnectSupported()- Specified by:
isReconnectSupported
in interfaceTransport
- Returns:
- true if reconnect is supported
-
isUpdateURIsSupported
public boolean isUpdateURIsSupported()- Specified by:
isUpdateURIsSupported
in interfaceTransport
- Returns:
- true if updating uris is supported
-
updateURIs
Description copied from interface:Transport
Provide a list of available alternative locations- Specified by:
updateURIs
in interfaceTransport
- Throws:
IOException
-
isDisposed
public boolean isDisposed()- Specified by:
isDisposed
in interfaceTransport
- Returns:
- true if the transport is disposed
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfaceTransport
- Returns:
- true if the transport is connected
-