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

EventBase is the foundation for creating application-specific events.

@example

  # SCENARIO: A continuation of the example in EventType.
  #
  #           An Event class is defined to handle receiving encrypted
  #           data from a remote endpoint.

  class EncryptedDataEvent < EventBase
    def initialize(message)
      super(EncryptedDataEvent, message,
            Qpid::Proton::Event::ENCRYPTED_RECV)
    end
  end

  # at another point, when encrypted data is received
  msg = Qpid::Proton::Message.new
  msg.decode(link.receive(link.pending))
  if encrypted?(msg)
    collector.put(EncryptedDataEvent.new(msg)
  end

@see EventType The EventType class for how ENCRYPTED_RECV was defined.

Methods

dispatch   new  

Attributes

class_name  [R]  Returns the name for the class associated with this event.
context  [R]  Returns the associated context object for the event.
type  [R]  Returns the type of the event.

Public Class methods

Creates a new event with the specific class_name and context of the specified type.

@param class_name [String] The name of the class. @param context [Object] The event context. @param type [EventType] The event type.

Public Instance methods

Invokes the type-specific method on the provided handler.

@param handler [Object] The handler to be notified of this event.

[Validate]