Package org.apache.activemq.transport.vm
Class VMTransport
- java.lang.Object
-
- org.apache.activemq.transport.vm.VMTransport
-
- All Implemented Interfaces:
org.apache.activemq.Service,org.apache.activemq.thread.Task,org.apache.activemq.transport.Transport
public class VMTransport extends Object implements org.apache.activemq.transport.Transport, org.apache.activemq.thread.Task
A Transport implementation that uses direct method invocations.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanasyncprotected intasyncQueueDepthprotected AtomicBooleandisposedprotected longidprotected URIlocationprotected static org.slf4j.LoggerLOGprotected booleanmarshalprotected VMTransportpeerprotected AtomicBooleanstartedprotected org.apache.activemq.transport.TransportListenertransportListener
-
Constructor Summary
Constructors Constructor Description VMTransport(URI location)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.activemq.transport.FutureResponseasyncRequest(Object command, org.apache.activemq.transport.ResponseCallback responseCallback)voiddispatch(VMTransport transport, BlockingQueue<Object> pending, Object command)voiddoDispatch(VMTransport transport, org.apache.activemq.transport.TransportListener transportListener, Object command)intgetAsyncQueueDepth()LinkedBlockingQueue<Object>getMessageQueue()X509Certificate[]getPeerCertificates()intgetReceiveCounter()StringgetRemoteAddress()protected org.apache.activemq.thread.TaskRunnergetTaskRunner()org.apache.activemq.transport.TransportListenergetTransportListener()org.apache.activemq.wireformat.WireFormatgetWireFormat()booleanisAsync()booleanisConnected()booleanisDisposed()booleanisFaultTolerant()booleanisMarshal()booleanisReconnectSupported()booleanisUpdateURIsSupported()booleaniterate()<T> Tnarrow(Class<T> target)voidoneway(Object command)voidreconnect(URI uri)Objectrequest(Object command)Objectrequest(Object command, int timeout)voidsetAsync(boolean async)voidsetAsyncQueueDepth(int asyncQueueDepth)voidsetMarshal(boolean marshal)voidsetPeer(VMTransport peer)voidsetPeerCertificates(X509Certificate[] certificates)voidsetTransportListener(org.apache.activemq.transport.TransportListener commandListener)voidstart()voidstop()StringtoString()voidupdateURIs(boolean reblance, URI[] uris)protected voidwakeup()
-
-
-
Field Detail
-
LOG
protected static final org.slf4j.Logger LOG
-
peer
protected VMTransport peer
-
transportListener
protected org.apache.activemq.transport.TransportListener transportListener
-
marshal
protected boolean marshal
-
async
protected boolean async
-
asyncQueueDepth
protected int asyncQueueDepth
-
location
protected final URI location
-
id
protected final long id
-
started
protected final AtomicBoolean started
-
disposed
protected final AtomicBoolean disposed
-
-
Constructor Detail
-
VMTransport
public VMTransport(URI location)
-
-
Method Detail
-
setPeer
public void setPeer(VMTransport peer)
-
oneway
public void oneway(Object command) throws IOException
- Specified by:
onewayin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
dispatch
public void dispatch(VMTransport transport, BlockingQueue<Object> pending, Object command)
-
doDispatch
public void doDispatch(VMTransport transport, org.apache.activemq.transport.TransportListener transportListener, Object command)
-
start
public void start() throws Exception- Specified by:
startin interfaceorg.apache.activemq.Service- Throws:
Exception
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceorg.apache.activemq.Service- Throws:
Exception
-
wakeup
protected void wakeup()
-
iterate
public boolean iterate()
- Specified by:
iteratein interfaceorg.apache.activemq.thread.Task- See Also:
Task.iterate()
-
setTransportListener
public void setTransportListener(org.apache.activemq.transport.TransportListener commandListener)
- Specified by:
setTransportListenerin interfaceorg.apache.activemq.transport.Transport
-
getMessageQueue
public LinkedBlockingQueue<Object> getMessageQueue() throws org.apache.activemq.transport.TransportDisposedIOException
- Throws:
org.apache.activemq.transport.TransportDisposedIOException
-
getTaskRunner
protected org.apache.activemq.thread.TaskRunner getTaskRunner() throws org.apache.activemq.transport.TransportDisposedIOException- Throws:
org.apache.activemq.transport.TransportDisposedIOException
-
asyncRequest
public org.apache.activemq.transport.FutureResponse asyncRequest(Object command, org.apache.activemq.transport.ResponseCallback responseCallback) throws IOException
- Specified by:
asyncRequestin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
request
public Object request(Object command) throws IOException
- Specified by:
requestin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
request
public Object request(Object command, int timeout) throws IOException
- Specified by:
requestin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
getTransportListener
public org.apache.activemq.transport.TransportListener getTransportListener()
- Specified by:
getTransportListenerin interfaceorg.apache.activemq.transport.Transport
-
narrow
public <T> T narrow(Class<T> target)
- Specified by:
narrowin interfaceorg.apache.activemq.transport.Transport
-
isMarshal
public boolean isMarshal()
-
setMarshal
public void setMarshal(boolean marshal)
-
getRemoteAddress
public String getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceorg.apache.activemq.transport.Transport
-
isAsync
public boolean isAsync()
- Returns:
- the async
-
setAsync
public void setAsync(boolean async)
- Parameters:
async- the async to set
-
getAsyncQueueDepth
public int getAsyncQueueDepth()
- Returns:
- the asyncQueueDepth
-
setAsyncQueueDepth
public void setAsyncQueueDepth(int asyncQueueDepth)
- Parameters:
asyncQueueDepth- the asyncQueueDepth to set
-
isFaultTolerant
public boolean isFaultTolerant()
- Specified by:
isFaultTolerantin interfaceorg.apache.activemq.transport.Transport
-
isDisposed
public boolean isDisposed()
- Specified by:
isDisposedin interfaceorg.apache.activemq.transport.Transport
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceorg.apache.activemq.transport.Transport
-
reconnect
public void reconnect(URI uri) throws IOException
- Specified by:
reconnectin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
isReconnectSupported
public boolean isReconnectSupported()
- Specified by:
isReconnectSupportedin interfaceorg.apache.activemq.transport.Transport
-
isUpdateURIsSupported
public boolean isUpdateURIsSupported()
- Specified by:
isUpdateURIsSupportedin interfaceorg.apache.activemq.transport.Transport
-
updateURIs
public void updateURIs(boolean reblance, URI[] uris) throws IOException- Specified by:
updateURIsin interfaceorg.apache.activemq.transport.Transport- Throws:
IOException
-
getReceiveCounter
public int getReceiveCounter()
- Specified by:
getReceiveCounterin interfaceorg.apache.activemq.transport.Transport
-
getPeerCertificates
public X509Certificate[] getPeerCertificates()
- Specified by:
getPeerCertificatesin interfaceorg.apache.activemq.transport.Transport
-
setPeerCertificates
public void setPeerCertificates(X509Certificate[] certificates)
- Specified by:
setPeerCertificatesin interfaceorg.apache.activemq.transport.Transport
-
getWireFormat
public org.apache.activemq.wireformat.WireFormat getWireFormat()
- Specified by:
getWireFormatin interfaceorg.apache.activemq.transport.Transport
-
-