Class: Qpid::Proton::Event Deprecated
- Inherits:
-
Object
- Object
- Qpid::Proton::Event
- Defined in:
- lib/core/event.rb
Overview
Only used with the deprecated Handler::MessagingHandler API.
Instance Attribute Summary collapse
-
#method ⇒ Symbol
(also: #type)
Method name that this event will call in #dispatch.
Instance Method Summary collapse
-
#condition ⇒ Condition
Error condition associated with this event or nil if none.
-
#connection ⇒ Connection?
The connection for this event.
-
#container ⇒ Container?
Container for this event.
-
#context ⇒ Object
The event context object.
-
#delivery ⇒ Delivery?
Delivery for this event.
- #dispatch(handler) ⇒ Boolean
- #inspect
-
#link ⇒ Link?
Link for this event.
-
#message ⇒ Message?
Message for this event.
-
#receiver ⇒ Receiver?
Receiver associated with this event.
-
#sender ⇒ Sender?
Sender associated with this event.
-
#session ⇒ Session?
Session for this event.
- #to_s
-
#tracker ⇒ Tracker?
Delivery for this event.
-
#transport ⇒ Transport?
Transport for this event.
Instance Attribute Details
#method ⇒ Symbol Also known as: type
Returns method name that this event will call in #dispatch.
98 99 100 |
# File 'lib/core/event.rb', line 98 def method @method end |
Instance Method Details
#condition ⇒ Condition
Returns Error condition associated with this event or nil if none.
145 146 147 148 |
# File 'lib/core/event.rb', line 145 def condition (context.remote_condition if context.respond_to? :remote_condition) || (context.condition if context.respond_to? :condition) end |
#connection ⇒ Connection?
Returns the connection for this event.
112 |
# File 'lib/core/event.rb', line 112 def connection() @connection ||= get(Connection, :connection); end |
#container ⇒ Container?
Returns container for this event.
106 |
# File 'lib/core/event.rb', line 106 def container() @container ||= get(Container, :container); end |
#context ⇒ Object
Returns the event context object.
103 |
# File 'lib/core/event.rb', line 103 def context; return @context ||= _context; end |
#delivery ⇒ Delivery?
Returns delivery for this event.
127 128 129 130 131 132 133 |
# File 'lib/core/event.rb', line 127 def delivery() @delivery ||= case context when Delivery then @delivery = @context # deprecated: for backwards compat allow a Tracker to be treated as a Delivery when Tracker then @delivery = Delivery.new(context.impl) end end |
#dispatch(handler) ⇒ Boolean
93 94 95 |
# File 'lib/core/event.rb', line 93 def dispatch(handler) (handler.__send__(@method, self); true) if handler.respond_to? @method end |
#inspect
142 |
# File 'lib/core/event.rb', line 142 def inspect() "#{self.class}(#{method.inspect}, #{context.inspect})"; end |
#link ⇒ Link?
Returns link for this event.
118 |
# File 'lib/core/event.rb', line 118 def link() @link ||= get(Link, :link); end |
#message ⇒ Message?
Returns message for this event.
139 |
# File 'lib/core/event.rb', line 139 def () @message ||= delivery. if delivery; end |
#receiver ⇒ Receiver?
Returns receiver associated with this event.
124 |
# File 'lib/core/event.rb', line 124 def receiver() link if link && link.receiver?; end |
#sender ⇒ Sender?
Returns sender associated with this event.
121 |
# File 'lib/core/event.rb', line 121 def sender() link if link && link.sender?; end |
#session ⇒ Session?
Returns session for this event.
115 |
# File 'lib/core/event.rb', line 115 def session() @session ||= get(Session, :session); end |
#to_s
141 |
# File 'lib/core/event.rb', line 141 def to_s() "#{self.class}(#{method}, #{context})"; end |