|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.callback.CallbackDispatcher
public class CallbackDispatcher
The CallbackDispatcher is able to generate listeners and callers for the Proxied Callback Pattern. This dispatcher holds onto the list of all the registered callers and listeners and facilities the communication between them. DevNote: Might be better to keep the collection of listeners as a list, ordered by the order of registration. Right now that information is lost. Alternatively we could just let the callback type handle the registered list of listeners.
Nested Class Summary | |
---|---|
static interface |
CallbackDispatcher.MyInterface
|
Constructor Summary | |
---|---|
CallbackDispatcher()
|
Method Summary | |
---|---|
java.lang.Object |
generateCaller(java.lang.Class iFace)
Generates a caller with the callback type of CallbackType.RETURN_LAST |
java.lang.Object |
generateCaller(java.lang.Class iFace,
CallbackType type)
Generates the 'caller' side of the caller/listener relationship. |
static void |
main(java.lang.String[] args)
|
void |
registerListener(java.lang.Class iFace,
java.lang.Object o)
Register a listener for a given interface. |
void |
unregisterListener(java.lang.Class iFace,
java.lang.Object o)
Unregister a previously registered listener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CallbackDispatcher()
Method Detail |
---|
public void registerListener(java.lang.Class iFace, java.lang.Object o)
iFace
- Interface to listen on. Must previously be registered
via generateCaller(Class)
o
- Listener which will be invoked when any of the methods
specified in 'iFace' is called. This object must
implement 'iFace'.public void unregisterListener(java.lang.Class iFace, java.lang.Object o)
registerListener(Class, Object)
public java.lang.Object generateCaller(java.lang.Class iFace)
CallbackType.RETURN_LAST
generateCaller(Class, CallbackType)
public java.lang.Object generateCaller(java.lang.Class iFace, CallbackType type)
registerListener(Class, Object)
for the given
interface will be executed.
The execution of the callbacks, the order they are called, the
exception handling, values returned etc. are all handled by the passed
CallbackType
.
iFace
- Interface to generate the caller fortype
- Type specifying the way that the caller will process
callbacks
public static void main(java.lang.String[] args)
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |