|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.barracuda.core.event.DefaultBaseEvent
This is the default implementation for the BaseEvent interface. It acts as the base class in the event heirarchy.
While events are capable of carrying state information, generally you want to keep them as lite as possible, storying any state either in the dispatch queue or the user's session.
NOTE: As general good practice, you should try and provide a no-args public constructor for all event classes. Anything that implements Polymorphic or Exceptional MUST have a noargs constructor, or the system will not be able to instantiate it.
Field Summary | |
protected java.lang.String |
ext
|
protected boolean |
handled
|
protected java.util.List |
idList
|
protected java.lang.Object |
source
|
protected java.util.EventObject |
sourceEvent
|
protected StateMap |
statemap
|
protected long |
timestamp
|
static boolean |
USE_ID_ALIASES
|
protected boolean |
useIDAliases
|
Fields inherited from interface org.enhydra.barracuda.core.event.BaseEvent |
EVENT_ID |
Constructor Summary | |
DefaultBaseEvent()
Default noargs constructor |
|
DefaultBaseEvent(java.lang.Object source)
Public constructor. |
Method Summary | |
void |
addListenerID(java.lang.String id)
Add a specific listener id this event should be delivered to. |
java.lang.Object |
clone()
clone the event |
boolean |
equals(java.lang.Object o)
Events are generally considered equal if they are of the same class. |
static java.lang.String |
getClassID(java.lang.Class cl)
Get a class ID for a given class. |
java.lang.String |
getEventExtension()
get the event extension |
java.lang.String |
getEventID()
Get the ID that identifies this event. |
java.lang.String |
getEventIDWithExtension()
Get the id + extension of this event. |
java.util.List |
getListenerIDs()
Get the list of id's this event is specifically targeted for. |
static BaseEvent |
getOriginalEvent(BaseEvent e)
Find the original event in target event's event chain (if it exists) |
BaseEvent |
getRootEvent()
get the root event source (may be null) |
static BaseEvent |
getRootEvent(BaseEvent be)
get the RootEvent that caused this event (if any). |
java.lang.Object |
getSource()
get the event source (may be null) |
java.lang.Object |
getState(java.lang.Object key)
get a property in this StateMap |
java.util.List |
getStateKeys()
get a list of the keys for this StateMap |
java.util.Map |
getStateValues()
get a copy of the underlying Map |
long |
getTimestamp()
Get the timestamp |
boolean |
isHandled()
get the handled status for the event |
void |
putState(java.lang.Object key,
java.lang.Object val)
set a property in this StateMap |
java.lang.Object |
removeState(java.lang.Object key)
remove a property in this StateMap |
void |
reset()
Reset the event to it's default state |
void |
setEventExtension(java.lang.String iext)
set the event extension |
void |
setHandled(boolean val)
mark the event as handled/unhandled |
void |
setSource(java.lang.Object isource)
set the source for an event |
void |
setUseIDAliases(boolean val)
determine whether or not we are using ID aliasing. |
void |
touch()
Update the timestamp on the event |
boolean |
useIDAliases()
see whether or not we are using ID aliasing |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean USE_ID_ALIASES
protected java.lang.Object source
protected java.util.EventObject sourceEvent
protected java.lang.String ext
protected boolean handled
protected java.util.List idList
protected long timestamp
protected boolean useIDAliases
protected StateMap statemap
Constructor Detail |
public DefaultBaseEvent()
public DefaultBaseEvent(java.lang.Object source)
Method Detail |
public void setSource(java.lang.Object isource)
setSource
in interface BaseEvent
isource
- the source for this eventpublic java.lang.Object getSource()
getSource
in interface BaseEvent
public BaseEvent getRootEvent()
getRootEvent
in interface BaseEvent
public void setEventExtension(java.lang.String iext)
setEventExtension
in interface BaseEvent
iext
- the target event extensionpublic java.lang.String getEventExtension()
getEventExtension
in interface BaseEvent
public void setUseIDAliases(boolean val)
val
- true if we want to use ID aliasingpublic boolean useIDAliases()
public void setHandled(boolean val)
setHandled
in interface BaseEvent
public boolean isHandled()
isHandled
in interface BaseEvent
public void addListenerID(java.lang.String id)
addListenerID
in interface BaseEvent
id
- the Listener ID the event should targetpublic java.util.List getListenerIDs()
getListenerIDs
in interface BaseEvent
public java.lang.String getEventID()
getEventID
in interface BaseEvent
public java.lang.String getEventIDWithExtension()
getEventIDWithExtension
in interface BaseEvent
public long getTimestamp()
getTimestamp
in interface BaseEvent
public void touch()
touch
in interface BaseEvent
public void reset()
reset
in interface BaseEvent
public static BaseEvent getOriginalEvent(BaseEvent e)
e
- the target event
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object we are checking against for equality
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public static java.lang.String getClassID(java.lang.Class cl)
cl
- the target class
public static BaseEvent getRootEvent(BaseEvent be)
be
- a BaseEvent for which we wish to find the root event
public void putState(java.lang.Object key, java.lang.Object val)
putState
in interface StateMap
key
- the state key objectval
- the state value objectpublic java.lang.Object getState(java.lang.Object key)
getState
in interface StateMap
key
- the state key object
public java.lang.Object removeState(java.lang.Object key)
removeState
in interface StateMap
key
- the key object
public java.util.List getStateKeys()
getStateKeys
in interface StateMap
public java.util.Map getStateValues()
getStateValues
in interface StateMap
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |