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 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 org.apache.activemq.transport.TransportListener
transportListener
-
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.FutureResponse
asyncRequest(Object command, org.apache.activemq.transport.ResponseCallback responseCallback)
void
dispatch(VMTransport transport, BlockingQueue<Object> pending, Object command)
void
doDispatch(VMTransport transport, org.apache.activemq.transport.TransportListener transportListener, Object command)
int
getAsyncQueueDepth()
LinkedBlockingQueue<Object>
getMessageQueue()
X509Certificate[]
getPeerCertificates()
int
getReceiveCounter()
String
getRemoteAddress()
protected org.apache.activemq.thread.TaskRunner
getTaskRunner()
org.apache.activemq.transport.TransportListener
getTransportListener()
org.apache.activemq.wireformat.WireFormat
getWireFormat()
boolean
isAsync()
boolean
isConnected()
boolean
isDisposed()
boolean
isFaultTolerant()
boolean
isMarshal()
boolean
isReconnectSupported()
boolean
isUpdateURIsSupported()
boolean
iterate()
<T> T
narrow(Class<T> target)
void
oneway(Object command)
void
reconnect(URI uri)
Object
request(Object command)
Object
request(Object command, int timeout)
void
setAsync(boolean async)
void
setAsyncQueueDepth(int asyncQueueDepth)
void
setMarshal(boolean marshal)
void
setPeer(VMTransport peer)
void
setPeerCertificates(X509Certificate[] certificates)
void
setTransportListener(org.apache.activemq.transport.TransportListener commandListener)
void
start()
void
stop()
String
toString()
void
updateURIs(boolean reblance, URI[] uris)
protected void
wakeup()
-
-
-
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:
oneway
in 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:
start
in interfaceorg.apache.activemq.Service
- Throws:
Exception
-
stop
public void stop() throws Exception
- Specified by:
stop
in interfaceorg.apache.activemq.Service
- Throws:
Exception
-
wakeup
protected void wakeup()
-
iterate
public boolean iterate()
- Specified by:
iterate
in interfaceorg.apache.activemq.thread.Task
- See Also:
Task.iterate()
-
setTransportListener
public void setTransportListener(org.apache.activemq.transport.TransportListener commandListener)
- Specified by:
setTransportListener
in 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:
asyncRequest
in interfaceorg.apache.activemq.transport.Transport
- Throws:
IOException
-
request
public Object request(Object command) throws IOException
- Specified by:
request
in interfaceorg.apache.activemq.transport.Transport
- Throws:
IOException
-
request
public Object request(Object command, int timeout) throws IOException
- Specified by:
request
in interfaceorg.apache.activemq.transport.Transport
- Throws:
IOException
-
getTransportListener
public org.apache.activemq.transport.TransportListener getTransportListener()
- Specified by:
getTransportListener
in interfaceorg.apache.activemq.transport.Transport
-
narrow
public <T> T narrow(Class<T> target)
- Specified by:
narrow
in interfaceorg.apache.activemq.transport.Transport
-
isMarshal
public boolean isMarshal()
-
setMarshal
public void setMarshal(boolean marshal)
-
getRemoteAddress
public String getRemoteAddress()
- Specified by:
getRemoteAddress
in 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:
isFaultTolerant
in interfaceorg.apache.activemq.transport.Transport
-
isDisposed
public boolean isDisposed()
- Specified by:
isDisposed
in interfaceorg.apache.activemq.transport.Transport
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interfaceorg.apache.activemq.transport.Transport
-
reconnect
public void reconnect(URI uri) throws IOException
- Specified by:
reconnect
in interfaceorg.apache.activemq.transport.Transport
- Throws:
IOException
-
isReconnectSupported
public boolean isReconnectSupported()
- Specified by:
isReconnectSupported
in interfaceorg.apache.activemq.transport.Transport
-
isUpdateURIsSupported
public boolean isUpdateURIsSupported()
- Specified by:
isUpdateURIsSupported
in interfaceorg.apache.activemq.transport.Transport
-
updateURIs
public void updateURIs(boolean reblance, URI[] uris) throws IOException
- Specified by:
updateURIs
in interfaceorg.apache.activemq.transport.Transport
- Throws:
IOException
-
getReceiveCounter
public int getReceiveCounter()
- Specified by:
getReceiveCounter
in interfaceorg.apache.activemq.transport.Transport
-
getPeerCertificates
public X509Certificate[] getPeerCertificates()
- Specified by:
getPeerCertificates
in interfaceorg.apache.activemq.transport.Transport
-
setPeerCertificates
public void setPeerCertificates(X509Certificate[] certificates)
- Specified by:
setPeerCertificates
in interfaceorg.apache.activemq.transport.Transport
-
getWireFormat
public org.apache.activemq.wireformat.WireFormat getWireFormat()
- Specified by:
getWireFormat
in interfaceorg.apache.activemq.transport.Transport
-
-