Modifier and Type | Field and Description |
---|---|
protected boolean |
async |
protected int |
asyncQueueDepth |
protected AtomicBoolean |
disposed |
protected long |
id |
protected URI |
location |
protected static org.slf4j.Logger |
LOG |
protected boolean |
marshal |
protected VMTransport |
peer |
protected AtomicBoolean |
started |
protected TransportListener |
transportListener |
Constructor and Description |
---|
VMTransport(URI location) |
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.
|
void |
dispatch(VMTransport transport,
BlockingQueue<Object> pending,
Object command) |
void |
doDispatch(VMTransport transport,
TransportListener transportListener,
Object command) |
int |
getAsyncQueueDepth() |
LinkedBlockingQueue<Object> |
getMessageQueue() |
X509Certificate[] |
getPeerCertificates() |
int |
getReceiveCounter()
Returns a counter which gets incremented as data is read from the transport.
|
String |
getRemoteAddress() |
protected TaskRunner |
getTaskRunner() |
TransportListener |
getTransportListener()
Returns the current transport listener
|
WireFormat |
getWireFormat()
Retrieves the WireFormat instance associated with this Transport instance.
|
boolean |
isAsync() |
boolean |
isConnected() |
boolean |
isDisposed() |
boolean |
isFaultTolerant()
Indicates if the transport can handle faults
|
boolean |
isMarshal() |
boolean |
isReconnectSupported() |
boolean |
isUpdateURIsSupported() |
boolean |
iterate() |
<T> T |
narrow(Class<T> target) |
void |
oneway(Object command)
A one way asynchronous send
|
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 |
setAsync(boolean async) |
void |
setAsyncQueueDepth(int asyncQueueDepth) |
void |
setMarshal(boolean marshal) |
void |
setPeer(VMTransport peer) |
void |
setPeerCertificates(X509Certificate[] certificates)
Sets the certificates provided by the connected peer.
|
void |
setTransportListener(TransportListener commandListener)
Registers an inbound command listener
|
void |
start() |
void |
stop() |
String |
toString() |
void |
updateURIs(boolean reblance,
URI[] uris)
Provide a list of available alternative locations
|
protected void |
wakeup() |
protected static final org.slf4j.Logger LOG
protected VMTransport peer
protected TransportListener transportListener
protected boolean marshal
protected boolean async
protected int asyncQueueDepth
protected final long id
protected final AtomicBoolean started
protected final AtomicBoolean disposed
public VMTransport(URI location)
public void setPeer(VMTransport peer)
public void oneway(Object command) throws IOException
Transport
oneway
in interface Transport
IOException
public void dispatch(VMTransport transport, BlockingQueue<Object> pending, Object command)
public void doDispatch(VMTransport transport, TransportListener transportListener, Object command)
protected void wakeup()
public boolean iterate()
iterate
in interface Task
Task.iterate()
public void setTransportListener(TransportListener commandListener)
Transport
setTransportListener
in interface Transport
public LinkedBlockingQueue<Object> getMessageQueue() throws TransportDisposedIOException
TransportDisposedIOException
protected TaskRunner getTaskRunner() throws TransportDisposedIOException
TransportDisposedIOException
public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException
Transport
asyncRequest
in interface Transport
responseCallback
- TODOIOException
public Object request(Object command) throws IOException
Transport
request
in interface Transport
IOException
public Object request(Object command, int timeout) throws IOException
Transport
request
in interface Transport
IOException
public TransportListener getTransportListener()
Transport
getTransportListener
in interface Transport
public boolean isMarshal()
public void setMarshal(boolean marshal)
public String getRemoteAddress()
getRemoteAddress
in interface Transport
public boolean isAsync()
public void setAsync(boolean async)
async
- the async to setpublic int getAsyncQueueDepth()
public void setAsyncQueueDepth(int asyncQueueDepth)
asyncQueueDepth
- the asyncQueueDepth to setpublic boolean isFaultTolerant()
Transport
isFaultTolerant
in interface Transport
public boolean isDisposed()
isDisposed
in interface Transport
public boolean isConnected()
isConnected
in interface Transport
public void reconnect(URI uri) throws IOException
Transport
reconnect
in interface Transport
IOException
- on failure of if not supportedpublic boolean isReconnectSupported()
isReconnectSupported
in interface Transport
public boolean isUpdateURIsSupported()
isUpdateURIsSupported
in interface Transport
public void updateURIs(boolean reblance, URI[] uris) throws IOException
Transport
updateURIs
in interface Transport
IOException
public int getReceiveCounter()
Transport
getReceiveCounter
in interface Transport
public X509Certificate[] getPeerCertificates()
getPeerCertificates
in interface Transport
public void setPeerCertificates(X509Certificate[] certificates)
Transport
setPeerCertificates
in interface Transport
certificates
- the Certificates provided by the peer.public WireFormat getWireFormat()
Transport
getWireFormat
in interface Transport
Copyright © 2005–2018 The Apache Software Foundation. All rights reserved.