|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.service.resource.ResourceEventDispatcher
A thread-safe class for dispatching events from data service
resources to data resource accessors. If a data resource accessor
implements the ResourceListener
interface
then it can be notified of data service resource events e.g. session
creation and termination. This class implements the
ResourceListener
interface for the sake of
consistency. Each time one of the methods of this interface is
invoked, the corresponding event will be dispatched to all
listeners.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private java.util.Collection |
mListeners
The listeners that are attached to this dispatcher. |
Constructor Summary | |
ResourceEventDispatcher()
|
Method Summary | |
void |
addListener(ResourceListener listener)
Registers listener which will be notified of subsequent resource events. |
void |
sessionCreated(ResourceEvent event)
Handles the "session created" event by invoking the sessionCreated method of all the listeners. |
void |
sessionTerminated(ResourceEvent event)
Handles the "session terminated" event by invoking the sessionTerminated method of all the listeners. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private final java.util.Collection mListeners
Constructor Detail |
public ResourceEventDispatcher()
Method Detail |
public void sessionCreated(ResourceEvent event)
sessionCreated
method of all the listeners.
sessionCreated
in interface ResourceListener
event
- the session eventpublic void sessionTerminated(ResourceEvent event)
sessionTerminated
method of all the listeners.
sessionTerminated
in interface ResourceListener
event
- the session eventpublic void addListener(ResourceListener listener)
listener
- The ResourceListener
to register.
java.lang.IllegalArgumentException
- if listener
is null
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |