Class: Qpid::Proton::MessagingHandler
- Inherits:
-
Object
- Object
- Qpid::Proton::MessagingHandler
- Defined in:
- lib/core/messaging_handler.rb
Overview
A handler for AMQP messaging events.
Subclass the handler and provide the #on_xxx methods with your event-handling code.
An AMQP endpoint (connection, session or link) must be opened and closed at each end. Normally proton responds automatically to an incoming open/close. You can prevent the automatic response by raising StopAutoResponse from #on_xxx_open
or #on_xxx_close
. The application becomes responsible for calling #open/#close at a later point.
Note: If a MessagingHandler method raises an exception, it will stop the Container that the handler is running in. See Container#run
Instance Attribute Summary collapse
-
#options ⇒ Hash
readonly
Handler options, see #initialize.
Most common events collapse
-
#on_container_start(container) ⇒ Object
The container event loop is started.
-
#on_container_stop(container) ⇒ Object
The container event loop is stopped.
-
#on_message(delivery, message) ⇒ Object
A message is received.
-
#on_sendable(sender) ⇒ Object
A message can be sent.
Endpoint lifecycle events collapse
-
#on_connection_close(connection) ⇒ Object
The remote peer closed the connection.
-
#on_connection_error(connection) ⇒ Object
The remote peer closed the connection with an error condition.
-
#on_connection_open(connection) ⇒ Object
The remote peer opened the connection.
-
#on_receiver_close(receiver) ⇒ Object
The remote peer closed the receiver.
-
#on_receiver_detach(receiver) ⇒ Object
The remote peer detached the receiver.
-
#on_receiver_error(receiver) ⇒ Object
The remote peer closed the receiver with an error condition.
-
#on_receiver_open(receiver) ⇒ Object
The remote peer opened the receiver.
-
#on_sender_close(sender) ⇒ Object
The remote peer closed the sender.
-
#on_sender_detach(sender) ⇒ Object
The remote peer detached the sender.
-
#on_sender_error(sender) ⇒ Object
The remote peer closed the sender with an error condition.
-
#on_sender_open(sender) ⇒ Object
The remote peer opened the sender.
-
#on_session_close(session) ⇒ Object
The remote peer closed the session.
-
#on_session_error(session) ⇒ Object
The remote peer closed the session with an error condition.
-
#on_session_open(session) ⇒ Object
The remote peer opened the session.
Delivery events collapse
-
#on_delivery_abort(delivery) ⇒ Object
A message was begun but aborted by the sender, so was not received.
-
#on_delivery_settle(delivery) ⇒ Object
The sending end settled a delivery.
-
#on_tracker_accept(tracker) ⇒ Object
The receiving end accepted a delivery.
-
#on_tracker_modify(tracker) ⇒ Object
The receiving end modified a delivery.
-
#on_tracker_reject(tracker) ⇒ Object
The receiving end rejected a delivery.
-
#on_tracker_release(tracker) ⇒ Object
The receiving end released a delivery.
-
#on_tracker_settle(tracker) ⇒ Object
The receiving end settled a delivery.
Flow control events collapse
-
#on_receiver_drain_finish(receiver) ⇒ Object
The remote end of the receiver completed draining.
-
#on_sender_drain_start(sender) ⇒ Object
The remote end of the sender requested draining.
Transport events collapse
-
#on_transport_close(transport) ⇒ Object
The underlying network channel closed.
-
#on_transport_error(transport) ⇒ Object
The underlying network channel is closing due to an error.
-
#on_transport_open(transport) ⇒ Object
The underlying network channel opened.
Unhandled events collapse
-
#on_error(error_condition) ⇒ Object
Called on an error if no more specific on_xxx_error method is provided.
-
#on_unhandled(method_name, *args) ⇒ Object
Called for events with no handler.
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns handler options, see #initialize.
37 38 39 |
# File 'lib/core/messaging_handler.rb', line 37 def @options end |
Instance Method Details
#on_connection_close(connection) ⇒ Object
The remote peer closed the connection
|
# File 'lib/core/messaging_handler.rb', line 66
|
#on_connection_error(connection) ⇒ Object
The remote peer closed the connection with an error condition
|
# File 'lib/core/messaging_handler.rb', line 70
|
#on_connection_open(connection) ⇒ Object
The remote peer opened the connection
|
# File 'lib/core/messaging_handler.rb', line 62
|
#on_container_start(container) ⇒ Object
The container event loop is started
|
# File 'lib/core/messaging_handler.rb', line 41
|
#on_container_stop(container) ⇒ Object
The container event loop is stopped
|
# File 'lib/core/messaging_handler.rb', line 45
|
#on_delivery_abort(delivery) ⇒ Object
A message was begun but aborted by the sender, so was not received.
|
# File 'lib/core/messaging_handler.rb', line 146
|
#on_delivery_settle(delivery) ⇒ Object
The sending end settled a delivery
|
# File 'lib/core/messaging_handler.rb', line 142
|
#on_error(error_condition) ⇒ Object
Called on an error if no more specific on_xxx_error method is provided. If on_error() is also not defined, the connection is closed with error_condition
|
# File 'lib/core/messaging_handler.rb', line 182
|
#on_message(delivery, message) ⇒ Object
A message is received.
|
# File 'lib/core/messaging_handler.rb', line 49
|
#on_receiver_close(receiver) ⇒ Object
The remote peer closed the receiver
|
# File 'lib/core/messaging_handler.rb', line 110
|
#on_receiver_detach(receiver) ⇒ Object
The remote peer detached the receiver
|
# File 'lib/core/messaging_handler.rb', line 106
|
#on_receiver_drain_finish(receiver) ⇒ Object
The remote end of the receiver completed draining
|
# File 'lib/core/messaging_handler.rb', line 158
|
#on_receiver_error(receiver) ⇒ Object
The remote peer closed the receiver with an error condition
|
# File 'lib/core/messaging_handler.rb', line 114
|
#on_receiver_open(receiver) ⇒ Object
The remote peer opened the receiver
|
# File 'lib/core/messaging_handler.rb', line 102
|
#on_sendable(sender) ⇒ Object
A message can be sent
|
# File 'lib/core/messaging_handler.rb', line 54
|
#on_sender_close(sender) ⇒ Object
The remote peer closed the sender
|
# File 'lib/core/messaging_handler.rb', line 94
|
#on_sender_detach(sender) ⇒ Object
The remote peer detached the sender
|
# File 'lib/core/messaging_handler.rb', line 90
|
#on_sender_drain_start(sender) ⇒ Object
The remote end of the sender requested draining
|
# File 'lib/core/messaging_handler.rb', line 154
|
#on_sender_error(sender) ⇒ Object
The remote peer closed the sender with an error condition
|
# File 'lib/core/messaging_handler.rb', line 98
|
#on_sender_open(sender) ⇒ Object
The remote peer opened the sender
|
# File 'lib/core/messaging_handler.rb', line 86
|
#on_session_close(session) ⇒ Object
The remote peer closed the session
|
# File 'lib/core/messaging_handler.rb', line 78
|
#on_session_error(session) ⇒ Object
The remote peer closed the session with an error condition
|
# File 'lib/core/messaging_handler.rb', line 82
|
#on_session_open(session) ⇒ Object
The remote peer opened the session
|
# File 'lib/core/messaging_handler.rb', line 74
|
#on_tracker_accept(tracker) ⇒ Object
The receiving end accepted a delivery
|
# File 'lib/core/messaging_handler.rb', line 122
|
#on_tracker_modify(tracker) ⇒ Object
The receiving end modified a delivery
|
# File 'lib/core/messaging_handler.rb', line 134
|
#on_tracker_reject(tracker) ⇒ Object
The receiving end rejected a delivery
|
# File 'lib/core/messaging_handler.rb', line 126
|
#on_tracker_release(tracker) ⇒ Object
The receiving end released a delivery
|
# File 'lib/core/messaging_handler.rb', line 130
|
#on_tracker_settle(tracker) ⇒ Object
The receiving end settled a delivery
|
# File 'lib/core/messaging_handler.rb', line 138
|
#on_transport_close(transport) ⇒ Object
The underlying network channel closed
|
# File 'lib/core/messaging_handler.rb', line 170
|
#on_transport_error(transport) ⇒ Object
The underlying network channel is closing due to an error.
|
# File 'lib/core/messaging_handler.rb', line 174
|
#on_transport_open(transport) ⇒ Object
The underlying network channel opened
|
# File 'lib/core/messaging_handler.rb', line 166
|
#on_unhandled(method_name, *args) ⇒ Object
Called for events with no handler. Similar to ruby’s standard #method_
|
# File 'lib/core/messaging_handler.rb', line 187
|