public class MockTransport extends DefaultTransportListener implements Transport
| Modifier and Type | Field and Description |
|---|---|
protected Transport |
next |
protected TransportListener |
transportListener |
| Constructor and Description |
|---|
MockTransport(Transport next) |
| Modifier and Type | Method and Description |
|---|---|
FutureResponse |
asyncRequest(Object command,
ResponseCallback responseCallback)
An asynchronous request response where the Receipt will be returned in
the future.
|
Transport |
getNext() |
int |
getReceiveCounter()
Returns a counter which gets incremented as data is read from the transport.
|
String |
getRemoteAddress() |
TransportListener |
getTransportListener()
Returns the current transport listener
|
void |
install(TransportFilter filter) |
boolean |
isConnected() |
boolean |
isDisposed() |
boolean |
isFaultTolerant()
Indicates if the transport can handle faults
|
boolean |
isReconnectSupported() |
boolean |
isUpdateURIsSupported() |
<T> T |
narrow(Class<T> target) |
void |
onCommand(Object command)
called to process a command
|
void |
oneway(Object command)
A one way asynchronous send
|
void |
onException(IOException error)
An unrecoverable exception has occured on the transport
|
void |
reconnect(URI uri)
reconnect to another location
|
Object |
request(Object command)
A synchronous request response
|
Object |
request(Object command,
int timeout)
A synchronous request response
|
void |
setNext(Transport next) |
void |
setTransportListener(TransportListener channelListener)
Registers an inbound command listener
|
void |
start() |
void |
stop() |
String |
toString() |
void |
updateURIs(boolean reblance,
URI[] uris)
Provide a list of available alternative locations
|
transportInterupted, transportResumedprotected TransportListener transportListener
public MockTransport(Transport next)
public void setTransportListener(TransportListener channelListener)
TransportsetTransportListener in interface Transportpublic void start() throws Exception
start in interface ServiceIOException - if the next channel has not been set.ExceptionService.start()public void stop() throws Exception
stop in interface ServiceExceptionService.stop()public void onCommand(Object command)
DefaultTransportListeneronCommand in interface TransportListeneronCommand in class DefaultTransportListenerpublic TransportListener getTransportListener()
TransportgetTransportListener in interface Transportpublic void oneway(Object command) throws IOException
Transportoneway in interface TransportIOExceptionpublic FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException
TransportasyncRequest in interface TransportresponseCallback - TODOIOExceptionpublic Object request(Object command) throws IOException
Transportrequest in interface TransportIOExceptionpublic Object request(Object command, int timeout) throws IOException
Transportrequest in interface TransportIOExceptionpublic void onException(IOException error)
DefaultTransportListeneronException in interface TransportListeneronException in class DefaultTransportListenerpublic void install(TransportFilter filter)
public String getRemoteAddress()
getRemoteAddress in interface Transportpublic boolean isFaultTolerant()
TransportisFaultTolerant in interface TransportTransport.isFaultTolerant()public boolean isDisposed()
isDisposed in interface Transportpublic boolean isConnected()
isConnected in interface Transportpublic void reconnect(URI uri) throws IOException
Transportreconnect in interface TransportIOException - on failure of if not supportedpublic int getReceiveCounter()
TransportgetReceiveCounter in interface Transportpublic boolean isReconnectSupported()
isReconnectSupported in interface Transportpublic boolean isUpdateURIsSupported()
isUpdateURIsSupported in interface Transportpublic void updateURIs(boolean reblance, URI[] uris) throws IOException
TransportupdateURIs in interface TransportIOExceptionCopyright © 2005–2015 FuseSource, Corp.. All rights reserved.