activemq::transport::TransportFilter Class Reference

#include <TransportFilter.h>

Inheritance diagram for activemq::transport::TransportFilter:

activemq::transport::Transport activemq::transport::CommandListener activemq::transport::TransportExceptionListener activemq::transport::ResponseCorrelator activemq::transport::TcpTransport List of all members.

Public Member Functions

 TransportFilter (Transport *next, const bool own=true)
virtual ~TransportFilter ()
virtual void onCommand (Command *command)
virtual void onTransportException (Transport *source, const exceptions::ActiveMQException &ex)
virtual void oneway (Command *command) throw (CommandIOException, exceptions::UnsupportedOperationException)
virtual Responserequest (Command *command) throw (CommandIOException, exceptions::UnsupportedOperationException)
virtual void setCommandListener (CommandListener *listener)
virtual void setCommandReader (CommandReader *reader)
virtual void setCommandWriter (CommandWriter *writer)
virtual void setTransportExceptionListener (TransportExceptionListener *listener)
virtual void start () throw ( cms::CMSException )
virtual void close () throw ( cms::CMSException )

Protected Member Functions

void fire (const exceptions::ActiveMQException &ex)
void fire (Command *command)

Protected Attributes

Transportnext
bool own
CommandListenercommandlistener
TransportExceptionListenerexceptionListener

Detailed Description

A filter on the transport layer. Transport filters implement the Transport interface and optionally delegate calls to another Transport object.


Constructor & Destructor Documentation

activemq::transport::TransportFilter::TransportFilter Transport next,
const bool  own = true
[inline]
 

Constructor.

Parameters:
next - the next Transport in the chain
own - true if this filter owns the next and should delete it

virtual activemq::transport::TransportFilter::~TransportFilter  )  [inline, virtual]
 


Member Function Documentation

virtual void activemq::transport::TransportFilter::close void   )  throw ( cms::CMSException ) [inline, virtual]
 

Stops the polling thread and closes the streams. This can be called explicitly, but is also called in the destructor. Once this object has been closed, it cannot be restarted.

Exceptions:
CMSException if errors occur.

Reimplemented in activemq::transport::ResponseCorrelator.

void activemq::transport::TransportFilter::fire Command command  )  [inline, protected]
 

Notify the command listener.

Parameters:
command - the command to send to the listener

void activemq::transport::TransportFilter::fire const exceptions::ActiveMQException ex  )  [inline, protected]
 

Notify the excpetion listener

Parameters:
ex - the exception to send to listeners

virtual void activemq::transport::TransportFilter::onCommand Command command  )  [inline, virtual]
 

Event handler for the receipt of a command.

Parameters:
command - the received command object.

Implements activemq::transport::CommandListener.

Reimplemented in activemq::transport::ResponseCorrelator.

virtual void activemq::transport::TransportFilter::oneway Command command  )  throw (CommandIOException, exceptions::UnsupportedOperationException) [inline, virtual]
 

Sends a one-way command. Does not wait for any response from the broker.

Parameters:
command the command to be sent.
Exceptions:
CommandIOException if an exception occurs during writing of the command.
UnsupportedOperationException if this method is not implemented by this transport.

Implements activemq::transport::Transport.

Reimplemented in activemq::transport::ResponseCorrelator.

virtual void activemq::transport::TransportFilter::onTransportException Transport source,
const exceptions::ActiveMQException ex
[inline, virtual]
 

Event handler for an exception from a command transport.

Parameters:
source The source of the exception
ex The exception.

Implements activemq::transport::TransportExceptionListener.

virtual Response* activemq::transport::TransportFilter::request Command command  )  throw (CommandIOException, exceptions::UnsupportedOperationException) [inline, virtual]
 

Not supported by this class - throws an exception.

Parameters:
command the command that is sent as a request
Exceptions:
UnsupportedOperationException. 

Implements activemq::transport::Transport.

Reimplemented in activemq::transport::ResponseCorrelator.

virtual void activemq::transport::TransportFilter::setCommandListener CommandListener listener  )  [inline, virtual]
 

Assigns the command listener for non-response commands.

Parameters:
listener the listener.

Implements activemq::transport::Transport.

Reimplemented in activemq::transport::ResponseCorrelator.

virtual void activemq::transport::TransportFilter::setCommandReader CommandReader reader  )  [inline, virtual]
 

Sets the command reader.

Parameters:
reader the object that will be used for reading command objects.

Implements activemq::transport::Transport.

virtual void activemq::transport::TransportFilter::setCommandWriter CommandWriter writer  )  [inline, virtual]
 

Sets the command writer.

Parameters:
writer the object that will be used for writing command objects.

Implements activemq::transport::Transport.

virtual void activemq::transport::TransportFilter::setTransportExceptionListener TransportExceptionListener listener  )  [inline, virtual]
 

Sets the observer of asynchronous exceptions from this transport.

Parameters:
listener the listener of transport exceptions.

Implements activemq::transport::Transport.

Reimplemented in activemq::transport::ResponseCorrelator.

virtual void activemq::transport::TransportFilter::start  )  throw ( cms::CMSException ) [inline, virtual]
 

Starts this transport object and creates the thread for polling on the input stream for commands. If this object has been closed, throws an exception. Before calling start, the caller must set the IO streams and the reader and writer objects.

Exceptions:
CMSException if an error occurs or if this transport has already been closed.

Reimplemented in activemq::transport::ResponseCorrelator.


Member Data Documentation

CommandListener* activemq::transport::TransportFilter::commandlistener [protected]
 

Listener to incoming commands.

TransportExceptionListener* activemq::transport::TransportFilter::exceptionListener [protected]
 

Listener of exceptions from this transport.

Transport* activemq::transport::TransportFilter::next [protected]
 

The transport that this filter wraps around.

bool activemq::transport::TransportFilter::own [protected]
 

Flag to indicate whether this object controls the lifetime of the next transport object.


The documentation for this class was generated from the following file:
Generated on Thu Aug 3 18:03:33 2006 for activemq-cpp by  doxygen 1.4.5