org.apache.activemq.transport.vm
Class VMTransport

java.lang.Object
  extended by org.apache.activemq.transport.vm.VMTransport
All Implemented Interfaces:
Service, Task, Transport

public class VMTransport
extends java.lang.Object
implements Transport, Task

A Transport implementation that uses direct method invocations.

Version:
$Revision$

Field Summary
protected  boolean async
           
protected  int asyncQueueDepth
           
protected  boolean disposed
           
protected  long id
           
protected  java.net.URI location
           
protected  boolean marshal
           
protected  edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue messageQueue
           
protected  boolean network
           
protected  VMTransport peer
           
protected  java.util.List prePeerSetQueue
           
protected  boolean started
           
protected  TransportListener transportListener
           
 
Constructor Summary
VMTransport(java.net.URI location)
           
 
Method Summary
protected  void asyncOneWay(java.lang.Object command)
           
 FutureResponse asyncRequest(java.lang.Object command, ResponseCallback responseCallback)
          An asynchronous request response where the Receipt will be returned in the future.
 int getAsyncQueueDepth()
           
protected  edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue getMessageQueue()
           
 VMTransport getPeer()
           
 java.lang.String getRemoteAddress()
           
 TransportListener getTransportListener()
          Returns the current transport listener
 boolean isAsync()
           
 boolean isMarshal()
           
 boolean isNetwork()
           
 boolean iterate()
           
 java.lang.Object narrow(java.lang.Class target)
           
 void oneway(java.lang.Object command)
          A one way asynchronous send
 java.lang.Object request(java.lang.Object command)
          A synchronous request response
 java.lang.Object request(java.lang.Object command, int timeout)
          A synchronous request response
 void setAsync(boolean async)
           
 void setAsyncQueueDepth(int asyncQueueDepth)
           
 void setMarshal(boolean marshal)
           
 void setNetwork(boolean network)
           
 void setPeer(VMTransport peer)
           
 void setTransportListener(TransportListener commandListener)
          Registers an inbound command listener
 void start()
           
 void stop()
           
protected  void syncOneWay(java.lang.Object command)
           
 java.lang.String toString()
           
protected  void wakeup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

peer

protected VMTransport peer

transportListener

protected TransportListener transportListener

disposed

protected boolean disposed

marshal

protected boolean marshal

network

protected boolean network

async

protected boolean async

started

protected boolean started

asyncQueueDepth

protected int asyncQueueDepth

prePeerSetQueue

protected java.util.List prePeerSetQueue

messageQueue

protected edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue messageQueue

location

protected final java.net.URI location

id

protected final long id
Constructor Detail

VMTransport

public VMTransport(java.net.URI location)
Method Detail

getPeer

public VMTransport getPeer()

setPeer

public void setPeer(VMTransport peer)

oneway

public void oneway(java.lang.Object command)
            throws java.io.IOException
Description copied from interface: Transport
A one way asynchronous send

Specified by:
oneway in interface Transport
Throws:
java.io.IOException

syncOneWay

protected void syncOneWay(java.lang.Object command)

asyncOneWay

protected void asyncOneWay(java.lang.Object command)
                    throws java.io.IOException
Throws:
java.io.IOException

asyncRequest

public FutureResponse asyncRequest(java.lang.Object command,
                                   ResponseCallback responseCallback)
                            throws java.io.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 interface Transport
responseCallback - TODO
Returns:
the FutureResponse
Throws:
java.io.IOException

request

public java.lang.Object request(java.lang.Object command)
                         throws java.io.IOException
Description copied from interface: Transport
A synchronous request response

Specified by:
request in interface Transport
Returns:
the response
Throws:
java.io.IOException

request

public java.lang.Object request(java.lang.Object command,
                                int timeout)
                         throws java.io.IOException
Description copied from interface: Transport
A synchronous request response

Specified by:
request in interface Transport
Returns:
the repsonse or null if timeout
Throws:
java.io.IOException

getTransportListener

public TransportListener getTransportListener()
Description copied from interface: Transport
Returns the current transport listener

Specified by:
getTransportListener in interface Transport
Returns:

setTransportListener

public void setTransportListener(TransportListener commandListener)
Description copied from interface: Transport
Registers an inbound command listener

Specified by:
setTransportListener in interface Transport

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Service
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Service
Throws:
java.lang.Exception

narrow

public java.lang.Object narrow(java.lang.Class target)
Specified by:
narrow in interface Transport
Returns:
the target

isMarshal

public boolean isMarshal()

setMarshal

public void setMarshal(boolean marshal)

isNetwork

public boolean isNetwork()

setNetwork

public void setNetwork(boolean network)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRemoteAddress

public java.lang.String getRemoteAddress()
Specified by:
getRemoteAddress in interface Transport
Returns:
the remote address for this connection

iterate

public boolean iterate()
Specified by:
iterate in interface Task
See Also:
Task.iterate()

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

wakeup

protected void wakeup()

getMessageQueue

protected edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue getMessageQueue()


Copyright © 2010 Apache Software Foundation. All Rights Reserved.