org.enhydra.barracuda.core.event
Class DefaultListenerFactory
java.lang.Object
|
+--org.enhydra.barracuda.core.event.DefaultListenerFactory
- All Implemented Interfaces:
- ListenerFactory
- Direct Known Subclasses:
- EventConnectorFactory, EventForwardingFactory, EventRedirectFactory, SampleControlHandler, SampleViewHandler
- public abstract class DefaultListenerFactory
- extends java.lang.Object
- implements ListenerFactory
This class provides the default implementaion for a
ListenerFactory
Note that a factory is responsible for ensuring threadsafety
within the underlying listener, so the factory should either
return a new instance of the listener OR keep one static
synchronized instance and return that instead.
Field Summary |
protected java.lang.String |
id
|
Method Summary |
protected java.lang.String |
getID(java.lang.Class cl)
|
abstract BaseEventListener |
getInstance()
Get an instance of the underlying BaseEventListener |
abstract java.lang.String |
getListenerID()
Get the Listener ID associated with this class of listener. |
boolean |
notifyAlways()
Return true if you want to always be notified, even when an event has
been handled by someone else. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
id
protected java.lang.String id
DefaultListenerFactory
public DefaultListenerFactory()
getInstance
public abstract BaseEventListener getInstance()
- Get an instance of the underlying BaseEventListener
- Specified by:
getInstance
in interface ListenerFactory
- Returns:
- get an instance of the BaseEventListener
notifyAlways
public boolean notifyAlways()
- Return true if you want to always be notified, even when an event has
been handled by someone else. Return false (default) when you only want
to notified if the event hasn't been handled already.
Typically, only logging type listeners would return true.
- Specified by:
notifyAlways
in interface ListenerFactory
- Returns:
- return true to be notified of the event even if it's already
been handled
getListenerID
public abstract java.lang.String getListenerID()
- Get the Listener ID associated with this class of listener. This will
generally either be the class name of the listener that the factory
creates
- Specified by:
getListenerID
in interface ListenerFactory
- Returns:
- the listener ID that describes this factory
getID
protected java.lang.String getID(java.lang.Class cl)
Copyright © 2001 Enhydra.org