|
| | IOTransport () |
| | Default Constructor.
|
| |
| | IOTransport (const Pointer< wireformat::WireFormat > wireFormat) |
| | Create an instance of this Transport and assign its WireFormat instance at creation time.
|
| |
| virtual | ~IOTransport () |
| |
| virtual void | setInputStream (decaf::io::DataInputStream *is) |
| | Sets the stream from which this Transport implementation will read its data.
|
| |
| virtual void | setOutputStream (decaf::io::DataOutputStream *os) |
| | Sets the stream to which this Transport implementation will write its data.
|
| |
| 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.- Parameters
-
| 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. |
- Returns
- A FutureResponse instance that can be queried for the Response to the Command.
- Exceptions
-
| IOException | if an exception occurs during the read of the command. |
| UnsupportedOperationException | if this method is not implemented by this transport. |
|
| |
| virtual Pointer< Response > | request (const Pointer< Command > command) |
| | Sends the given command to the broker and then waits for the response.- Parameters
-
| command | the command to be sent. |
- Returns
- the response from the broker.
- Exceptions
-
| IOException | if an exception occurs during the read of the command. |
| UnsupportedOperationException | if this method is not implemented by this transport. |
|
| |
| virtual Pointer< Response > | request (const Pointer< Command > command, unsigned int timeout) |
| | Sends the given command to the broker and then waits for the response.- Parameters
-
| command | The command to be sent. |
| timeout | The time to wait for this response. |
- Returns
- the response from the broker.
- Exceptions
-
| IOException | if an exception occurs during the read of the command. |
| UnsupportedOperationException | if this method is not implemented by 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 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 void | start () |
| | Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started.
|
| |
| virtual void | stop () |
| | Stops the Transport.
|
| |
| virtual void | close () |
| | Closes this object and deallocates the appropriate resources.
|
| |
| 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 | isClosed () const |
| | Has the Transport been shutdown and no longer usable.
|
| |
| virtual std::string | getRemoteAddress () const |
| |
| virtual bool | isReconnectSupported () const |
| |
| virtual bool | isUpdateURIsSupported () const |
| |
| virtual void | updateURIs (bool rebalance AMQCPP_UNUSED, const decaf::util::List< decaf::net::URI > &uris AMQCPP_UNUSED) |
| |
| virtual void | reconnect (const decaf::net::URI &uri AMQCPP_UNUSED) |
| |
| virtual void | run () |
| | Run method - called by the Thread class in the context of the thread.
|
| |
| virtual | ~Transport () |
| |
| virtual void | start ()=0 |
| | Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started.
|
| |
| virtual void | stop ()=0 |
| | Stops the Transport.
|
| |
| virtual void | oneway (const Pointer< Command > command)=0 |
| | Sends a one-way command.
|
| |
| virtual Pointer< FutureResponse > | asyncRequest (const Pointer< Command > command, const Pointer< ResponseCallback > responseCallback)=0 |
| | 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)=0 |
| | Sends the given command to the broker and then waits for the response.
|
| |
| virtual Pointer< Response > | request (const Pointer< Command > command, unsigned int timeout)=0 |
| | Sends the given command to the broker and then waits for the response.
|
| |
| virtual Pointer< wireformat::WireFormat > | getWireFormat () const =0 |
| | Gets the WireFormat instance that is in use by this transport.
|
| |
| virtual void | setWireFormat (const Pointer< wireformat::WireFormat > wireFormat)=0 |
| | Sets the WireFormat instance to use.
|
| |
| virtual void | setTransportListener (TransportListener *listener)=0 |
| | Sets the observer of asynchronous events from this transport.
|
| |
| virtual TransportListener * | getTransportListener () const =0 |
| | Gets the observer of asynchronous events from this transport.
|
| |
| virtual Transport * | narrow (const std::type_info &typeId)=0 |
| | 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 =0 |
| | Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
|
| |
| virtual bool | isConnected () const =0 |
| | Is the Transport Connected to its Broker.
|
| |
| virtual bool | isClosed () const =0 |
| | Has the Transport been shutdown and no longer usable.
|
| |
| virtual bool | isReconnectSupported () const =0 |
| |
| virtual bool | isUpdateURIsSupported () const =0 |
| |
| virtual std::string | getRemoteAddress () const =0 |
| |
| virtual void | reconnect (const decaf::net::URI &uri)=0 |
| | reconnect to another location
|
| |
| virtual void | updateURIs (bool rebalance, const decaf::util::List< decaf::net::URI > &uris)=0 |
| | Updates the set of URIs the Transport can connect to.
|
| |
| virtual | ~Service () |
| |
| virtual void | start ()=0 |
| |
| virtual void | stop ()=0 |
| |
| virtual | ~Closeable () |
| |
| virtual void | close ()=0 |
| | Closes this object and deallocates the appropriate resources.
|
| |
| virtual | ~Runnable () |
| |
| virtual void | run ()=0 |
| | Run method - called by the Thread class in the context of the thread.
|
| |
Implementation of the Transport interface that performs marshaling of commands to IO streams.
This class does not implement the Transport::request method, it only handles oneway messages. A thread polls on the input stream for in-coming commands. When a command is received, the command listener is notified. The polling thread is not started until the start method is called. Polling can be suspending by calling stop; however, because the read operation is blocking the transport my still pull one command off the wire even after the stop method has been called.
The close method will close the associated streams. Close can be called explicitly by the user, but is also called in the destructor. Once this object has been closed, it cannot be restarted.