|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.taursys.xml.event.Dispatcher
Component responsible for receiving and dispatching Events. Components should register with this component to be notified whenever their events occur.
Field Summary | |
protected java.util.ArrayList |
components
|
protected java.util.Map |
map
|
Constructor Summary | |
Dispatcher()
|
Method Summary | |
void |
addNotify(Component c)
Adds a component to the notification list unless it is already registered |
void |
dispatch()
Dispatches an Event to each registered component with an empty key/value map. |
void |
dispatch(java.util.EventObject e)
Dispatches the given Event to each registered component with an empty key/value Map . |
void |
dispatch(java.util.Map map)
Dispatches an Event to each registered component with the given key/value Map . |
abstract void |
dispatchToComponent(Component c)
Dispatches an Event to the given component. |
protected int |
getIndex()
Get this Dispatcher's index. |
protected java.lang.String |
getParameter(java.lang.String key,
java.lang.String defaultValue)
Get the parameter value at the current index for the given key. |
Dispatcher |
getParentDispatcher()
Get the parent Dispatcher for this Dispatcher. |
protected int |
getParentIndex()
Get the parent index value, else this Dispatcher's index value if no parent. |
protected void |
incrementIndex()
Increments the parameter array index by one. |
void |
removeNotify(Component c)
Removes a component from the notification list if it is registered |
protected void |
resetIndex()
Resets the parameter array index to zero. |
void |
setParentDispatcher(Dispatcher dispatcher)
Set the parent Dispatcher for this Dispatcher. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.ArrayList components
protected java.util.Map map
Constructor Detail |
public Dispatcher()
Method Detail |
public abstract void dispatchToComponent(Component c) throws java.lang.Exception
Event
to the given component. Concrete
Dispatchers must override this method to provide appropriate behavior.
c
- the Component
to dispatch the event to.
java.lang.Exception
- from the components dispatchEvent
method
if occurs.public void dispatch(java.util.Map map) throws java.lang.Exception
Map
. This method invokes the dispatchToComponent
for each registered component.
map
- a Map containing message key/values for dispatching
java.lang.Exception
public void dispatch() throws java.lang.Exception
dispatchToComponent
for each registered component.
java.lang.Exception
public void dispatch(java.util.EventObject e) throws java.lang.Exception
Map
.
e
- the Event to dispatch
java.lang.Exception
protected java.lang.String getParameter(java.lang.String key, java.lang.String defaultValue)
key
- the String key for the parameter valuedefaultValue
- the String to return if key is not present
protected int getParentIndex()
protected int getIndex()
public void addNotify(Component c)
public void removeNotify(Component c)
protected void resetIndex()
protected void incrementIndex()
public Dispatcher getParentDispatcher()
public void setParentDispatcher(Dispatcher dispatcher)
dispatcher
- The parent Dispatcher for this Dispatcher
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |