|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.EventObject | +--com.ibm.able.AbleEvent
This class defines the event object used for notification and actions (method invocation) on other AbleBeans and AbleObjects. It supports specification of both synchronous and asynchronous treatment by the AbleEventListeners.
AbleEvent objects are immutable; however, an argument object can be manipulated by the user. If this is undesirable, the user must clone() the argument object before constructing an AbleEvent object.
AbleEvent objects consist of:
Event attributes include an event name, and an optional action String that can be used for routing purposes. When an event object is instantiated, a creation timestamp and a unique ID are added to the event as well.
An argument object can be an instance of any object class as required by the application.
Note that for action events (those events that have an action string specified), the "action" is taken to be the name of a method on the target AbleEventListener object, and the argument object is passed to that method as the single argument.
Note that all event attributes and the argument object (if used) must be specified when the event is constructed. There is no provision for setting these items after an AbleEvent is constructed.
AbleEventListener
, Serialized FormField Summary | |
protected java.lang.String |
action
action is either null or it contains the name of a method to call on an AbleEventListener. |
static int |
ACTION
|
protected java.lang.Object |
argObject
argObject is either null or it contains any arbitrary object that makes sense to the AbleEventListener. |
protected boolean |
asynchronous
asynchronous indicates the type of event processing desired. |
static int |
DATACHANGED
|
static int |
EOF
|
protected java.lang.Object |
genSource
genSource contains a nontransient version of the source generating the event. |
protected int |
id
id is the type of AbleEvent. |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary | |
AbleEvent(java.lang.Object theSource,
java.lang.Object theArgObject)
Create a new AbleEvent. |
|
AbleEvent(java.lang.Object theSource,
java.lang.Object theArgObject,
int theId)
Create a new asynchronous AbleEvent. |
|
AbleEvent(java.lang.Object theSource,
java.lang.Object theArgObject,
int theId,
boolean sync)
Create a new AbleEvent. |
|
AbleEvent(java.lang.Object theSource,
java.lang.Object theArgObject,
java.lang.String theAction)
Create a new asynchronous AbleEvent. |
|
AbleEvent(java.lang.Object theSource,
java.lang.Object theArgObject,
java.lang.String theAction,
boolean sync)
Create a new action AbleEvent. |
Method Summary | |
java.lang.String |
getAction()
Retrieve the event's action string. |
java.lang.Object |
getArgObject()
Retrieve the event's argument object. |
java.lang.Object |
getGenSource()
Retrieve the event's generating source. |
int |
getId()
Return the event id |
boolean |
isAsynchronous()
Returns true if the event should be handled asynchronously or false if synchronous |
java.lang.String |
toString()
Retrieve a string describing (the contents of) the object. |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static int ACTION
public static int DATACHANGED
public static int EOF
protected final java.lang.String action
protected final int id
protected boolean asynchronous
protected java.lang.Object argObject
When an argObject exists, but no action is specified, the default behavior is UNDEFINED. *FIX* ?
protected final java.lang.Object genSource
Constructor Detail |
public AbleEvent(java.lang.Object theSource, java.lang.Object theArgObject)
theSource
- The object that is creating and using this event.
theArgObject
- An object to be passed to the event listener. This parameter
is optional and therefore may be specified as null.
public AbleEvent(java.lang.Object theSource, java.lang.Object theArgObject, int theId)
theSource
- The Able object that is creating and using this event.
theArgObject
- An object to be passed to the event listener.
This parameter is optional and therefore may be specified as
null.
theId
- An event type of identified constant.
null.
public AbleEvent(java.lang.Object theSource, java.lang.Object theArgObject, java.lang.String theAction)
theSource
- The Able object that is creating and using this event.
theArgObject
- An object to be passed to the event listener.
This parameter is optional and therefore may be specified as null.
theAction
- A string containing the name of a method to invoke on the
event listener. The method will be passed the argObject.
public AbleEvent(java.lang.Object theSource, java.lang.Object theArgObject, java.lang.String theAction, boolean sync)
theSource
- The Able object that is creating and using this event.
theArgObject
- An object to be passed to the event listener.
This parameter is optional and therefore may be specified as null.
theAction
- A string containing the name of a method to invoke on the
event listener. The method will be passed the argObject.
sync
- Whether the event should be processed asynchronously or synchronously
public AbleEvent(java.lang.Object theSource, java.lang.Object theArgObject, int theId, boolean sync)
theSource
- The Able object that is creating and using this event.
theArgObject
- An object to be passed to the event listener.
This parameter is optional and therefore may be specified as
null.
theId
- An event type of identified constant.
null.
sync
- Whether the event should be processed asynchronously or synchronously.
null.
Method Detail |
public java.lang.Object getArgObject()
Note that it is not guaranteed that the argument is immutable, unless the argument is restricted (by the caller) to clonable.
public int getId()
public java.lang.String getAction()
public boolean isAsynchronous()
public java.lang.Object getGenSource()
public java.lang.String toString()
|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |