com.syncbuilder.service
Class ServiceStateQueueAdaptor
java.lang.Object
|
+--com.syncbuilder.service.ServiceStateQueueAdaptor
- public class ServiceStateQueueAdaptor
- extends java.lang.Object
- implements ServiceStateListener
This class serves two purposes:
1. It decouples the source of ServiceStateEvents from its listeners,
thus ensuring uninterrupted service, even if there is a problem with
event-delivery
2. It offers multicasting, which makes it unneccessary for event sources
to implement their own version of multicasting.
The life-cycle of the adaptor begins with the invocation of the constructor
and ends with the invocation of the destroy()-method. It is always up and
running in between these two points in time (you do not need to start or
stop it, nor is this possible).
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ServiceStateQueueAdaptor
public ServiceStateQueueAdaptor()
- Create a working ServiceStateQueueAdaptor. When this constructor
has finished the Adaptor is running and ready for delivery of
events.
stateChanged
public void stateChanged(ServiceStateEvent sse)
- This method is part of the ServiceStateListener interface.
Events which are sent to this method are delivered to all
registered listeners. This is a non-blocking call!
- Specified by:
- stateChanged in interface ServiceStateListener
addServiceStateListener
public void addServiceStateListener(ServiceStateListener ssl)
- Register a listener with the adaptor.
removeServiceStateListener
public void removeServiceStateListener(ServiceStateListener ssl)
- Unregister a listener from the adaptor. The listener will still
receive all events which were scheduled for it by the time it was
unregistered.
destroy
public void destroy()
- Ask the adaptor to release its resources and to cease working.
Undelivered events may get lost. This call is idempotent!
finalize
protected void finalize()
throws java.lang.Throwable
- Overrides:
- finalize in class java.lang.Object
This material is Copyrighted (C) 1999 by Tilo Christ. All Rights Reserved.