Class Qpid::Proton::Event::Event
In: lib/event/event.rb
Parent: EventBase

An Event provides notification of a state change within the protocol engine.

Every event has a type that identifies what sort of state change has occurred, along with a pointer to the object whose state has changed, and also any associated objects.

For more details on working with Event, please refer to Collector.

@see Qpid::Proton::Event The list of predefined events.

Methods

connection   container   delivery   dispatch   link   message   message=   new   reactor   receiver   sender   session   to_s   transport   wrap  

Included Modules

Qpid::Proton::Util::ClassWrapper Qpid::Proton::Util::Wrapper

Public Class methods

Creates a Ruby object for the given pn_event_t.

@private

Public Instance methods

Returns the Connection for this event.

@return [Connection, nil] The connection.

Returns the Delivery associated with this event.

@return [Delivery, nil] The delivery.

Notifies the handler(s) of this event.

If a handler responds to the event‘s method then that method is invoked and passed the event. Otherwise, if the handler defines the on_unhandled method, then that will be invoked instead.

If the handler defines a handlers method then that will be invoked and passed the event afterward.

@example

  class FallbackEventHandler

    # since it now defines a handlers method, any event will iterate
    # through them and invoke the +dispatch+ method on each
    attr_accessor handlers

    def initialize
      @handlers = []
    end

    # invoked for any event not otherwise handled
    def on_unhandled(event)
      puts "Unable to invoke #{event.type.method} on #{event.context}."
    end

  end

@param handler [Object] An object which implements either the event‘s

   handler method or else responds to :handlers with an array of other
   handlers.

Returns the Link for this event.

@return [Link, nil] The link.

Returns the message.

@return [Qpid::Proton::Message] The message.

Returns the reactor for this event.

@return [Reactor, nil] The reactor.

Returns the Receiver, or nil if there is no Link, associated with this event if that link is a receiver.

@return [Receiver, nil] The receiver.

Returns the Sender, or nil if there is no Link, associated with this event if that link is a sender.

@return [Sender, nil] The sender.

Returns the Session for this event.

@return [Session, nil] The session

@private

Returns the transport for this event.

@return [Transport, nil] The transport.

[Validate]