|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.millstone.base.event.EventRouter
Event router class implementing the MillStone inheritable event listening model. For more information on the event model see the org.millstone.base.event.
Constructor Summary | |
EventRouter()
|
Method Summary | |
void |
addListener(java.lang.Class eventType,
java.lang.Object object,
java.lang.reflect.Method method)
Registers a new event listener with the specified activation method to listen events generated by this component. |
void |
addListener(java.lang.Class eventType,
java.lang.Object object,
java.lang.String methodName)
Registers a new listener with the specified activation method to listen events generated by this component. |
void |
fireEvent(java.util.EventObject event)
Send an event to all registered listeners. |
void |
removeAllListeners()
Remove all listeners from event router |
void |
removeListener(java.lang.Class eventType,
java.lang.Object target)
Removes all registered listeners matching the given parameters. |
void |
removeListener(java.lang.Class eventType,
java.lang.Object target,
java.lang.reflect.Method method)
Removes one registered listener method. |
void |
removeListener(java.lang.Class eventType,
java.lang.Object target,
java.lang.String methodName)
Removes one registered listener method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventRouter()
Method Detail |
public void addListener(java.lang.Class eventType, java.lang.Object object, java.lang.reflect.Method method)
MethodEventSource
Registers a new event listener with the specified activation method to listen events generated by this component. If the activation method does not have any arguments the event object will not be passed to it when it's called.
For more information on the MillStone inheritable event mechanism see the org.millstone.base.event.
addListener
in interface MethodEventSource
eventType
- type of the listened event. Events of this type or
its subclasses activate the listener.object
- the object instance who owns the activation methodmethod
- the activation methodpublic void addListener(java.lang.Class eventType, java.lang.Object object, java.lang.String methodName)
MethodEventSource
Registers a new listener with the specified activation method to listen events generated by this component. If the activation method does not have any arguments the event object will not be passed to it when it's called.
This version of addListener
gets the name of the
activation method as a parameter. The actual method is reflected from
object
, and unless exactly one match is found,
java.lang.IllegalArgumentException
is thrown.
For more information on the MillStone inheritable event mechanism see the org.millstone.base.event.
addListener
in interface MethodEventSource
eventType
- type of the listened event. Events of this type or
its subclasses activate the listener.object
- the object instance who owns the activation methodmethodName
- the name of the activation methodpublic void removeListener(java.lang.Class eventType, java.lang.Object target)
MethodEventSource
object
's methods that
are registered to listen to events of type eventType
generated by this component.
For more information on the MillStone inheritable event mechanism see the org.millstone.base.event.
removeListener
in interface MethodEventSource
eventType
- exact event type the object
listens totarget
- target object that has registered to listen to events
of type eventType
with one or more methodspublic void removeListener(java.lang.Class eventType, java.lang.Object target, java.lang.reflect.Method method)
MethodEventSource
For more information on the MillStone inheritable event mechanism see the org.millstone.base.event.
removeListener
in interface MethodEventSource
eventType
- exact event type the object
listens totarget
- target object that has registered to listen to events
of type eventType
with one or more methodsmethod
- the method owned by target
that's
registered to listen to events of type eventType
public void removeListener(java.lang.Class eventType, java.lang.Object target, java.lang.String methodName)
MethodEventSource
Removes one registered listener method. The given method owned by the given object will no longer be called when the specified events are generated by this component.
This version of removeListener
gets the name of the
activation method as a parameter. The actual method is reflected from
target
, and unless exactly one match is found,
java.lang.IllegalArgumentException
is thrown.
For more information on the MillStone inheritable event mechanism see the org.millstone.base.event.
removeListener
in interface MethodEventSource
eventType
- exact event type the object
listens totarget
- target object that has registered to listen to events
of type eventType
with one or more methodsmethodName
- name of the method owned by target
that's registered to listen to events of type eventType
public void removeAllListeners()
public void fireEvent(java.util.EventObject event)
event
- Event to be sent to all listeners
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |