org.apache.activemq.transport
Class TransportFilter

java.lang.Object
  extended by org.apache.activemq.transport.TransportFilter
All Implemented Interfaces:
Service, Transport, TransportListener
Direct Known Subclasses:
CommandJoiner, DiscoveryTransport, InactivityMonitor, MarshallingTransportFilter, MutexTransport, ResponseCorrelator, ResponseRedirectInterceptor, StompTransportFilter, TransportLogger, WireFormatNegotiator

public class TransportFilter
extends java.lang.Object
implements TransportListener, Transport

Version:
$Revision: 1.5 $

Field Summary
protected  Transport next
           
protected  TransportListener transportListener
           
 
Constructor Summary
TransportFilter(Transport next)
           
 
Method Summary
 FutureResponse asyncRequest(java.lang.Object command, ResponseCallback responseCallback)
          An asynchronous request response where the Receipt will be returned in the future.
 Transport getNext()
           
 java.lang.String getRemoteAddress()
           
 TransportListener getTransportListener()
          Returns the current transport listener
 java.lang.Object narrow(java.lang.Class target)
           
 void onCommand(java.lang.Object command)
          called to process a command
 void oneway(java.lang.Object command)
          A one way asynchronous send
 void onException(java.io.IOException error)
          An unrecoverable exception has occured on the transport
 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 setTransportListener(TransportListener channelListener)
          Registers an inbound command listener
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 void transportInterupted()
          The transport has suffered an interuption from which it hopes to recover
 void transportResumed()
          The transport has resumed after an interuption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

next

protected final Transport next

transportListener

protected TransportListener transportListener
Constructor Detail

TransportFilter

public TransportFilter(Transport next)
Method Detail

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 channelListener)
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.io.IOException - if the next channel has not been set.
java.lang.Exception
See Also:
Service.start()

stop

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

onCommand

public void onCommand(java.lang.Object command)
Description copied from interface: TransportListener
called to process a command

Specified by:
onCommand in interface TransportListener

getNext

public Transport getNext()
Returns:
Returns the next.

toString

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

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

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

onException

public void onException(java.io.IOException error)
Description copied from interface: TransportListener
An unrecoverable exception has occured on the transport

Specified by:
onException in interface TransportListener

transportInterupted

public void transportInterupted()
Description copied from interface: TransportListener
The transport has suffered an interuption from which it hopes to recover

Specified by:
transportInterupted in interface TransportListener

transportResumed

public void transportResumed()
Description copied from interface: TransportListener
The transport has resumed after an interuption

Specified by:
transportResumed in interface TransportListener

narrow

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

getRemoteAddress

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


Copyright © 2011 Apache Software Foundation. All Rights Reserved.