Package org.apache.activemq.transport
Interface Transport
- All Superinterfaces:
Service
- All Known Subinterfaces:
CompositeTransport
,WSTransport
- All Known Implementing Classes:
AbstractInactivityMonitor
,CommandJoiner
,DiscoveryTransport
,FailoverTransport
,FanoutTransport
,InactivityMonitor
,MarshallingTransportFilter
,MockTransport
,MulticastTransport
,MutexTransport
,NIOSSLTransport
,NIOTransport
,ReliableTransport
,ResponseCorrelator
,ResponseRedirectInterceptor
,SslTransport
,TcpTransport
,ThreadNameFilter
,TransportFilter
,TransportSupport
,TransportThreadSupport
,UdpTransport
,WireFormatNegotiator
,WriteTimeoutFilter
Represents the client side of a transport allowing messages to be sent
synchronously, asynchronously and consumed.
-
Method Summary
Modifier and TypeMethodDescriptionasyncRequest
(Object command, ResponseCallback responseCallback) An asynchronous request response where the Receipt will be returned in the future.int
Returns a counter which gets incremented as data is read from the transport.Returns the current transport listenerRetrieves the WireFormat instance associated with this Transport instance.boolean
boolean
boolean
Indicates if the transport can handle faultsboolean
boolean
<T> T
void
A one way asynchronous sendvoid
reconnect to another locationA synchronous request responseA synchronous request responsevoid
setPeerCertificates
(X509Certificate[] certificates) Sets the certificates provided by the connected peer.void
setTransportListener
(TransportListener commandListener) Registers an inbound command listenervoid
updateURIs
(boolean rebalance, URI[] uris) Provide a list of available alternative locations
-
Method Details
-
oneway
A one way asynchronous send- Parameters:
command
-- Throws:
IOException
-
asyncRequest
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.- Parameters:
command
-responseCallback
- TODO- Returns:
- the FutureResponse
- Throws:
IOException
-
request
A synchronous request response- Parameters:
command
-- Returns:
- the response
- Throws:
IOException
-
request
A synchronous request response- Parameters:
command
-timeout
-- Returns:
- the repsonse or null if timeout
- Throws:
IOException
-
getTransportListener
TransportListener getTransportListener()Returns the current transport listener- Returns:
-
setTransportListener
Registers an inbound command listener- Parameters:
commandListener
-
-
narrow
- Parameters:
target
-- Returns:
- the target
-
getRemoteAddress
String getRemoteAddress()- Returns:
- the remote address for this connection
-
isFaultTolerant
boolean isFaultTolerant()Indicates if the transport can handle faults- Returns:
- true if fault tolerant
-
isDisposed
boolean isDisposed()- Returns:
- true if the transport is disposed
-
isConnected
boolean isConnected()- Returns:
- true if the transport is connected
-
isReconnectSupported
boolean isReconnectSupported()- Returns:
- true if reconnect is supported
-
isUpdateURIsSupported
boolean isUpdateURIsSupported()- Returns:
- true if updating uris is supported
-
reconnect
reconnect to another location- Parameters:
uri
-- Throws:
IOException
- on failure of if not supported
-
updateURIs
Provide a list of available alternative locations- Parameters:
rebalance
-uris
-- Throws:
IOException
-
getReceiveCounter
int getReceiveCounter()Returns a counter which gets incremented as data is read from the transport. It should only be used to determine if there is progress being made in reading the next command from the transport. The value may wrap into the negative numbers.- Returns:
- a counter which gets incremented as data is read from the transport.
-
getPeerCertificates
X509Certificate[] getPeerCertificates()- Returns:
- the Certificates provided by the peer, or null if not a secure channel.
-
setPeerCertificates
Sets the certificates provided by the connected peer.- Parameters:
certificates
- the Certificates provided by the peer.
-
getWireFormat
WireFormat getWireFormat()Retrieves the WireFormat instance associated with this Transport instance.- Returns:
- the WireFormat in use.
-