A filter on the transport layer. More...
#include <src/main/activemq/transport/TransportFilter.h>

Public Member Functions | |
| TransportFilter (const Pointer< Transport > next) | |
| Constructor. | |
| virtual | ~TransportFilter () |
| void | start () |
| Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started. | |
| void | stop () |
| Stops the Transport. | |
| void | close () |
| Closes this object and deallocates the appropriate resources. | |
| virtual void | onCommand (const Pointer< Command > command) |
| Event handler for the receipt of a command. | |
| virtual void | onException (const decaf::lang::Exception &ex) |
| Event handler for an exception from a command transport. | |
| virtual void | transportInterrupted () |
| The transport has suffered an interruption from which it hopes to recover. | |
| virtual void | transportResumed () |
| The transport has resumed after an interruption. | |
| virtual void | oneway (const Pointer< Command > command) |
| Sends a one-way command. | |
| virtual Pointer< FutureResponse > | asyncRequest (const Pointer< Command > command, const Pointer< ResponseCallback > responseCallback) |
| Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker. | |
| virtual Pointer< Response > | request (const Pointer< Command > command) |
| Sends the given command to the broker and then waits for the response. | |
| virtual Pointer< Response > | request (const Pointer< Command > command, unsigned int timeout) |
| Sends the given command to the broker and then waits for the response. | |
| virtual void | setTransportListener (TransportListener *listener) |
| Sets the observer of asynchronous events from this transport. | |
| virtual TransportListener * | getTransportListener () const |
| Gets the observer of asynchronous events from this transport. | |
| virtual Pointer < wireformat::WireFormat > | getWireFormat () const |
| Gets the WireFormat instance that is in use by this transport. | |
| virtual void | setWireFormat (const Pointer< wireformat::WireFormat > wireFormat) |
| Sets the WireFormat instance to use. | |
| virtual Transport * | narrow (const std::type_info &typeId) |
| Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip intermediate Transports in certain circumstances. | |
| virtual bool | isFaultTolerant () const |
| Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect. | |
| virtual bool | isConnected () const |
| Is the Transport Connected to its Broker. | |
| virtual bool | isReconnectSupported () const |
| virtual bool | isUpdateURIsSupported () const |
| virtual bool | isClosed () const |
| Has the Transport been shutdown and no longer usable. | |
| virtual std::string | getRemoteAddress () const |
| virtual void | reconnect (const decaf::net::URI &uri) |
| reconnect to another location | |
| virtual void | updateURIs (bool rebalance, const decaf::util::List< decaf::net::URI > &uris) |
| Updates the set of URIs the Transport can connect to. | |
Protected Member Functions | |
| void | checkClosed () const |
| Throws an IOException if this filter chain has already been closed. | |
| virtual void | beforeNextIsStarted () |
| Subclasses can override this method to do their own startup work. | |
| virtual void | afterNextIsStarted () |
| Subclasses can override this method to do their own post startup work. | |
| virtual void | beforeNextIsStopped () |
| Subclasses can override this method to do their own pre-stop work. | |
| virtual void | afterNextIsStopped () |
| Subclasses can override this method to do their own stop work. | |
| virtual void | doClose () |
| Subclasses can override this method to do their own close work. | |
Protected Attributes | |
| Pointer< Transport > | next |
| The transport that this filter wraps around. | |
| TransportListener * | listener |
| Listener of this transport. | |
A filter on the transport layer.
Transport filters implement the Transport interface and optionally delegate calls to another Transport object.
Constructor.
| next | - the next Transport in the chain |
| virtual activemq::transport::TransportFilter::~TransportFilter | ( | ) | [virtual] |
| virtual void activemq::transport::TransportFilter::afterNextIsStarted | ( | ) | [inline, protected, virtual] |
Subclasses can override this method to do their own post startup work.
This method will always be called after the doStart() method and the next transport's own start() methods have been successfully run.
Reimplemented in activemq::transport::inactivity::InactivityMonitor, and activemq::wireformat::openwire::OpenWireFormatNegotiator.
| virtual void activemq::transport::TransportFilter::afterNextIsStopped | ( | ) | [inline, protected, virtual] |
Subclasses can override this method to do their own stop work.
This method is always called after all the next transports have been stopped to prevent this transport for destroying resources needed by the lower level transports.
Reimplemented in activemq::transport::tcp::TcpTransport, and activemq::wireformat::openwire::OpenWireFormatNegotiator.
| virtual Pointer<FutureResponse> activemq::transport::TransportFilter::asyncRequest | ( | const Pointer< Command > | command, | |
| const Pointer< ResponseCallback > | responseCallback | |||
| ) | [inline, virtual] |
Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker.
| command | The Command object that is to sent out. | |
| responseCallback | A callback object that will be notified once a response to the command is received. |
| IOException | if an exception occurs during the read of the command. | |
| UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
Reimplemented in activemq::transport::correlator::ResponseCorrelator.
| virtual void activemq::transport::TransportFilter::beforeNextIsStarted | ( | ) | [inline, protected, virtual] |
Subclasses can override this method to do their own startup work.
This method will always be called before the next transport in the chain is called in order to allow this transport a chance to initialize required resources.
Reimplemented in activemq::transport::tcp::TcpTransport.
| virtual void activemq::transport::TransportFilter::beforeNextIsStopped | ( | ) | [inline, protected, virtual] |
Subclasses can override this method to do their own pre-stop work.
This method will always be called before the next transport's own stop() method or this filter's own doStop() method is called.
Reimplemented in activemq::transport::inactivity::InactivityMonitor.
| void activemq::transport::TransportFilter::checkClosed | ( | ) | const [protected] |
Throws an IOException if this filter chain has already been closed.
| void activemq::transport::TransportFilter::close | ( | ) | [virtual] |
Closes this object and deallocates the appropriate resources.
The object is generally no longer usable after calling close.
| IOException | if an error occurs while closing. |
Implements decaf::io::Closeable.
| virtual void activemq::transport::TransportFilter::doClose | ( | ) | [inline, protected, virtual] |
Subclasses can override this method to do their own close work.
This method is always called after all the next transports have been closed to prevent this transport for destroying resources needed by the lower level transports.
Reimplemented in activemq::transport::correlator::ResponseCorrelator, activemq::transport::inactivity::InactivityMonitor, and activemq::transport::tcp::TcpTransport.
| virtual std::string activemq::transport::TransportFilter::getRemoteAddress | ( | ) | const [inline, virtual] |
Implements activemq::transport::Transport.
| virtual TransportListener* activemq::transport::TransportFilter::getTransportListener | ( | ) | const [inline, virtual] |
Gets the observer of asynchronous events from this transport.
Implements activemq::transport::Transport.
| virtual Pointer<wireformat::WireFormat> activemq::transport::TransportFilter::getWireFormat | ( | ) | const [virtual] |
Gets the WireFormat instance that is in use by this transport.
In the case of nested transport this method delegates down to the lowest level transport that actually maintains a WireFormat info instance.
Implements activemq::transport::Transport.
| virtual bool activemq::transport::TransportFilter::isClosed | ( | ) | const [virtual] |
Has the Transport been shutdown and no longer usable.
Implements activemq::transport::Transport.
| virtual bool activemq::transport::TransportFilter::isConnected | ( | ) | const [inline, virtual] |
Is the Transport Connected to its Broker.
Implements activemq::transport::Transport.
Reimplemented in activemq::transport::tcp::TcpTransport.
| virtual bool activemq::transport::TransportFilter::isFaultTolerant | ( | ) | const [inline, virtual] |
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
Implements activemq::transport::Transport.
Reimplemented in activemq::transport::tcp::TcpTransport.
| virtual bool activemq::transport::TransportFilter::isReconnectSupported | ( | ) | const [inline, virtual] |
Implements activemq::transport::Transport.
| virtual bool activemq::transport::TransportFilter::isUpdateURIsSupported | ( | ) | const [inline, virtual] |
Implements activemq::transport::Transport.
| virtual Transport* activemq::transport::TransportFilter::narrow | ( | const std::type_info & | typeId | ) | [virtual] |
Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip intermediate Transports in certain circumstances.
| typeId | - The type_info of the Object we are searching for. |
Implements activemq::transport::Transport.
| virtual void activemq::transport::TransportFilter::onCommand | ( | const Pointer< Command > | command | ) | [virtual] |
Event handler for the receipt of a command.
| command | - the received command object. |
Implements activemq::transport::TransportListener.
Reimplemented in activemq::transport::correlator::ResponseCorrelator, activemq::transport::inactivity::InactivityMonitor, activemq::transport::logging::LoggingTransport, and activemq::wireformat::openwire::OpenWireFormatNegotiator.
| virtual void activemq::transport::TransportFilter::oneway | ( | const Pointer< Command > | command | ) | [inline, virtual] |
Sends a one-way command.
Does not wait for any response from the broker.
| command | The command to be sent. |
| IOException | 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::correlator::ResponseCorrelator, activemq::transport::inactivity::InactivityMonitor, activemq::transport::logging::LoggingTransport, and activemq::wireformat::openwire::OpenWireFormatNegotiator.
| virtual void activemq::transport::TransportFilter::onException | ( | const decaf::lang::Exception & | ex | ) | [virtual] |
Event handler for an exception from a command transport.
| ex | The exception to handle. |
Implements activemq::transport::TransportListener.
Reimplemented in activemq::transport::correlator::ResponseCorrelator, activemq::transport::inactivity::InactivityMonitor, and activemq::wireformat::openwire::OpenWireFormatNegotiator.
| virtual void activemq::transport::TransportFilter::reconnect | ( | const decaf::net::URI & | uri | ) | [virtual] |
reconnect to another location
| uri | The new URI to connect this Transport to. |
| IOException | on failure or if reconnect is not supported. |
Implements activemq::transport::Transport.
| virtual Pointer<Response> activemq::transport::TransportFilter::request | ( | const Pointer< Command > | command, | |
| unsigned int | timeout | |||
| ) | [inline, virtual] |
Sends the given command to the broker and then waits for the response.
| command | The command to be sent. | |
| timeout | The time to wait for this response. |
| IOException | if an exception occurs during the read of the command. | |
| UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
Reimplemented in activemq::transport::correlator::ResponseCorrelator, activemq::transport::logging::LoggingTransport, and activemq::wireformat::openwire::OpenWireFormatNegotiator.
| virtual Pointer<Response> activemq::transport::TransportFilter::request | ( | const Pointer< Command > | command | ) | [inline, virtual] |
Sends the given command to the broker and then waits for the response.
| command | the command to be sent. |
| IOException | if an exception occurs during the read of the command. | |
| UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
Reimplemented in activemq::transport::correlator::ResponseCorrelator, activemq::transport::logging::LoggingTransport, and activemq::wireformat::openwire::OpenWireFormatNegotiator.
| virtual void activemq::transport::TransportFilter::setTransportListener | ( | TransportListener * | listener | ) | [inline, virtual] |
Sets the observer of asynchronous events from this transport.
| listener | the listener of transport events. |
Implements activemq::transport::Transport.
| virtual void activemq::transport::TransportFilter::setWireFormat | ( | const Pointer< wireformat::WireFormat > | wireFormat | ) | [virtual] |
Sets the WireFormat instance to use.
| wireFormat | The WireFormat the object used to encode / decode commands. |
Implements activemq::transport::Transport.
| void activemq::transport::TransportFilter::start | ( | ) | [virtual] |
Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started.
| IOException | if and error occurs while starting the Transport. |
Implements activemq::transport::Transport.
| void activemq::transport::TransportFilter::stop | ( | ) | [virtual] |
Stops the Transport.
| IOException | if an error occurs while stopping the transport. |
Implements activemq::transport::Transport.
| virtual void activemq::transport::TransportFilter::transportInterrupted | ( | ) | [virtual] |
The transport has suffered an interruption from which it hopes to recover.
Implements activemq::transport::TransportListener.
| virtual void activemq::transport::TransportFilter::transportResumed | ( | ) | [virtual] |
The transport has resumed after an interruption.
Implements activemq::transport::TransportListener.
| virtual void activemq::transport::TransportFilter::updateURIs | ( | bool | rebalance, | |
| const decaf::util::List< decaf::net::URI > & | uris | |||
| ) | [inline, virtual] |
Updates the set of URIs the Transport can connect to.
If the Transport doesn't support updating its URIs then an IOException is thrown.
| rebalance | Indicates if a forced reconnection should be performed as a result of the update. | |
| uris | The new list of URIs that can be used for connection. |
| IOException | if an error occurs or updates aren't supported. |
Implements activemq::transport::Transport.
Listener of this transport.
Pointer<Transport> activemq::transport::TransportFilter::next [protected] |
The transport that this filter wraps around.
1.6.1