Package org.apache.activemq.transport
Interface Transport
-
- All Superinterfaces:
Service
- All Known Subinterfaces:
CompositeTransport
,WSTransport
- All Known Implementing Classes:
AbstractInactivityMonitor
,AbstractMQTTSocket
,AbstractStompSocket
,AmqpInactivityMonitor
,AmqpNioSslTransport
,AmqpNioTransport
,AmqpTransportFilter
,AmqpWSTransport
,AutoInitNioSSLTransport
,AutoNIOTransport
,BlockingQueueTransport
,CommandJoiner
,DiscoveryTransport
,FailoverTransport
,FanoutTransport
,HttpClientTransport
,HttpInactivityMonitor
,HttpsClientTransport
,HttpTransportSupport
,InactivityMonitor
,MarshallingTransportFilter
,MockTransport
,MQTTInactivityMonitor
,MQTTNIOSSLTransport
,MQTTNIOTransport
,MQTTSocket
,MQTTTransportFilter
,MulticastTransport
,MutexTransport
,NIOSSLTransport
,NIOTransport
,ReliableTransport
,ResponseCorrelator
,ResponseRedirectInterceptor
,SslTransport
,StompInactivityMonitor
,StompNIOSSLTransport
,StompNIOTransport
,StompSocket
,StompTransportFilter
,TcpTransport
,ThreadNameFilter
,TransportFilter
,TransportLogger
,TransportSupport
,TransportThreadSupport
,UdpTransport
,VMTransport
,WireFormatNegotiator
,WriteTimeoutFilter
,WSTransportProxy
public interface Transport extends Service
Represents the client side of a transport allowing messages to be sent synchronously, asynchronously and consumed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FutureResponse
asyncRequest(Object command, ResponseCallback responseCallback)
An asynchronous request response where the Receipt will be returned in the future.X509Certificate[]
getPeerCertificates()
int
getReceiveCounter()
Returns a counter which gets incremented as data is read from the transport.String
getRemoteAddress()
TransportListener
getTransportListener()
Returns the current transport listenerWireFormat
getWireFormat()
Retrieves the WireFormat instance associated with this Transport instance.boolean
isConnected()
boolean
isDisposed()
boolean
isFaultTolerant()
Indicates if the transport can handle faultsboolean
isReconnectSupported()
boolean
isUpdateURIsSupported()
<T> T
narrow(Class<T> target)
void
oneway(Object command)
A one way asynchronous sendvoid
reconnect(URI uri)
reconnect to another locationObject
request(Object command)
A synchronous request responseObject
request(Object command, int timeout)
A 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 Detail
-
oneway
void oneway(Object command) throws IOException
A one way asynchronous send- Parameters:
command
-- Throws:
IOException
-
asyncRequest
FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException
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
Object request(Object command) throws IOException
A synchronous request response- Parameters:
command
-- Returns:
- the response
- Throws:
IOException
-
request
Object request(Object command, int timeout) throws IOException
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
void setTransportListener(TransportListener commandListener)
Registers an inbound command listener- Parameters:
commandListener
-
-
narrow
<T> T narrow(Class<T> target)
- 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
void reconnect(URI uri) throws IOException
reconnect to another location- Parameters:
uri
-- Throws:
IOException
- on failure of if not supported
-
updateURIs
void updateURIs(boolean rebalance, URI[] uris) throws IOException
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
void setPeerCertificates(X509Certificate[] certificates)
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.
-
-