org.exolab.jms.events
Class Event

java.lang.Object
  |
  +--org.exolab.jms.events.Event
All Implemented Interfaces:
java.io.Serializable

public class Event
extends java.lang.Object
implements java.io.Serializable

This class specifies the object that is used by the EventManager. It defines the event type, the event listener and the callback object.

The event type is an integral value that identifies the type of event to fire. It is transparent to the EventManager.

The event listener must implement the EventHandler interface.

The callback object must be Serializable and is passed back to the EventHandler when the event fires.

Most importantly this class is Serializable so that it can be stored, if required.

Version:
$Revision: 1.1 $ $Date: 2004/11/26 01:50:41 $
Author:
Jim Alateras
See Also:
Serialized Form

Constructor Summary
Event(int event, EventHandler listener, java.lang.Object callback)
          The constructor instantiates an instance of this class with the specified parameters.
 
Method Summary
 java.lang.Object getCallbackObject()
          Return a reference to the callbacl object.
 EventHandler getEventListener()
          Return the event listener
 int getEventType()
          Return the event type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Event

public Event(int event,
             EventHandler listener,
             java.lang.Object callback)
      throws IllegalEventDefinedException
The constructor instantiates an instance of this class with the specified parameters. The event and listener must be non-null and valid but the callback object may be null.
Parameters:
event - the type of event to fire
listener - the object that will receive the event
callback - a callback object, that is Serializable
Throws:
IllegalEventDefinedException -  
Method Detail

getEventType

public int getEventType()
Return the event type.
Returns:
int

getEventListener

public EventHandler getEventListener()
Return the event listener
Returns:
EventHandler

getCallbackObject

public java.lang.Object getCallbackObject()
Return a reference to the callbacl object. The returned object may be null
Returns:
Object


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.