Class MockTransport
java.lang.Object
org.apache.activemq.transport.DefaultTransportListener
org.apache.activemq.transport.mock.MockTransport
- All Implemented Interfaces:
Service
,Transport
,TransportListener
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasyncRequest
(Object command, ResponseCallback responseCallback) An asynchronous request response where the Receipt will be returned in the future.getNext()
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.void
install
(TransportFilter filter) boolean
boolean
boolean
Indicates if the transport can handle faultsboolean
boolean
<T> T
void
called to process a commandvoid
A one way asynchronous sendvoid
onException
(IOException error) An unrecoverable exception has occured on the transportvoid
reconnect to another locationA synchronous request responseA synchronous request responsevoid
void
setPeerCertificates
(X509Certificate[] certificates) Sets the certificates provided by the connected peer.void
setTransportListener
(TransportListener channelListener) Registers an inbound command listenervoid
start()
void
stop()
toString()
void
updateURIs
(boolean reblance, URI[] uris) Provide a list of available alternative locationsMethods inherited from class org.apache.activemq.transport.DefaultTransportListener
transportInterupted, transportResumed
-
Field Details
-
next
-
transportListener
-
-
Constructor Details
-
MockTransport
-
-
Method Details
-
setTransportListener
Description copied from interface:Transport
Registers an inbound command listener- Specified by:
setTransportListener
in interfaceTransport
-
start
- Specified by:
start
in interfaceService
- Throws:
IOException
- if the next channel has not been set.Exception
- See Also:
-
stop
-
onCommand
Description copied from class:DefaultTransportListener
called to process a command- Specified by:
onCommand
in interfaceTransportListener
- Overrides:
onCommand
in classDefaultTransportListener
-
getNext
- Returns:
- Returns the getNext().
-
getTransportListener
Description copied from interface:Transport
Returns the current transport listener- Specified by:
getTransportListener
in interfaceTransport
- Returns:
- Returns the packetListener.
-
toString
-
oneway
Description copied from interface:Transport
A one way asynchronous send- Specified by:
oneway
in interfaceTransport
- Throws:
IOException
-
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
-
onException
Description copied from class:DefaultTransportListener
An unrecoverable exception has occured on the transport- Specified by:
onException
in interfaceTransportListener
- Overrides:
onException
in classDefaultTransportListener
-
narrow
-
setNext
-
install
-
getRemoteAddress
- Specified by:
getRemoteAddress
in interfaceTransport
- Returns:
- the remote address for this connection
-
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
- See Also:
-
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
-
reconnect
Description copied from interface:Transport
reconnect to another location- Specified by:
reconnect
in interfaceTransport
- Throws:
IOException
- on failure of if not supported
-
getReceiveCounter
public int getReceiveCounter()Description copied from interface:Transport
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.- Specified by:
getReceiveCounter
in interfaceTransport
- Returns:
- a counter which gets incremented as data is read from the transport.
-
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
-
getPeerCertificates
- Specified by:
getPeerCertificates
in interfaceTransport
- Returns:
- the Certificates provided by the peer, or null if not a secure channel.
-
setPeerCertificates
Description copied from interface:Transport
Sets the certificates provided by the connected peer.- Specified by:
setPeerCertificates
in interfaceTransport
- Parameters:
certificates
- the Certificates provided by the peer.
-
getWireFormat
Description copied from interface:Transport
Retrieves the WireFormat instance associated with this Transport instance.- Specified by:
getWireFormat
in interfaceTransport
- Returns:
- the WireFormat in use.
-