Class: Qpid::Proton::Event Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/core/event.rb

Overview

Deprecated.

Only used with the deprecated Handler::MessagingHandler API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#methodSymbol Also known as: type

Returns method name that this event will call in #dispatch.

Returns:

  • (Symbol)

    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

#conditionCondition

Returns Error condition associated with this event or nil if none.

Returns:

  • (Condition)

    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

#connectionConnection?

Returns the connection for this event.

Returns:

  • (Connection, nil)

    the connection for this event



112
# File 'lib/core/event.rb', line 112

def connection() @connection ||= get(Connection, :connection); end

#containerContainer?

Returns container for this event.

Returns:

  • (Container, nil)

    container for this event



106
# File 'lib/core/event.rb', line 106

def container() @container ||= get(Container, :container); end

#contextObject

Returns the event context object.

Returns:

  • (Object)

    the event context object



103
# File 'lib/core/event.rb', line 103

def context; return @context ||= _context; end

#deliveryDelivery?

Returns delivery for this event.

Returns:

  • (Delivery, nil)

    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

Call handler.#method(self) if handler.respond_to? #method

Returns:

  • (Boolean)

    true if handler responded to the method, nil if not.



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

Returns link for this event.

Returns:

  • (Link, nil)

    link for this event



118
# File 'lib/core/event.rb', line 118

def link() @link ||= get(Link, :link); end

#messageMessage?

Returns message for this event.

Returns:

  • (Message, nil)

    message for this event



139
# File 'lib/core/event.rb', line 139

def message() @message ||= delivery.message if delivery; end

#receiverReceiver?

Returns receiver associated with this event.

Returns:

  • (Receiver, nil)

    receiver associated with this event



124
# File 'lib/core/event.rb', line 124

def receiver() link if link && link.receiver?; end

#senderSender?

Returns sender associated with this event.

Returns:

  • (Sender, nil)

    sender associated with this event



121
# File 'lib/core/event.rb', line 121

def sender() link if link && link.sender?; end

#sessionSession?

Returns session for this event.

Returns:

  • (Session, nil)

    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

#trackerTracker?

Returns delivery for this event.

Returns:

  • (Tracker, nil)

    delivery for this event



136
# File 'lib/core/event.rb', line 136

def tracker() @tracker ||= get(Tracker); end

#transportTransport?

Returns transport for this event.

Returns:

  • (Transport, nil)

    transport for this event



109
# File 'lib/core/event.rb', line 109

def transport() @transport ||= get(Transport, :transport); end