kaos.core.csi.observe
Class KAoSObservableImpl
java.lang.Object
kaos.core.csi.observe.KAoSObservableImpl
- All Implemented Interfaces:
- KAoSObservable
- Direct Known Subclasses:
- VideoFeedObservable
public class KAoSObservableImpl
- extends java.lang.Object
- implements KAoSObservable
- Author:
- jlott
Constructor Summary |
KAoSObservableImpl(MessageTransportService mts,
Locator senderLocator,
java.lang.String senderName)
Creates a new instance of KAoSObservableImpl |
Method Summary |
void |
deregisterObserver(java.lang.String updateType,
java.lang.Object updateCondition,
KAoSObserver observer)
Deregister the given KAoSObserver for the given update type from the registry of observers associated with this KAoSObservable. |
protected boolean |
isObserverRegisteredForCondition(java.lang.String updateType,
java.lang.Object condition)
|
void |
notify(java.lang.String updateType,
java.lang.Object updateCondition,
java.lang.Object update)
Notify observers interested in the given updateType wiht the given update object. |
void |
registerObserver(java.lang.String updateType,
java.lang.Object updateCondition,
KAoSObserver observer)
Register the given KAoSObserver with this KAoSObservable for updates
described by the updateType and updateConstraints. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_logger
protected Logger _logger
_name
public java.lang.String _name
KAoSObservableImpl
public KAoSObservableImpl(MessageTransportService mts,
Locator senderLocator,
java.lang.String senderName)
- Creates a new instance of KAoSObservableImpl
registerObserver
public void registerObserver(java.lang.String updateType,
java.lang.Object updateCondition,
KAoSObserver observer)
- Description copied from interface:
KAoSObservable
- Register the given KAoSObserver with this KAoSObservable for updates
described by the updateType and updateConstraints.
- Specified by:
registerObserver
in interface KAoSObservable
- Parameters:
updateType
- String indicating type of update the KAoSObserver is interested in.updateCondition
- Object describing the conditions under which to send the update.observer
- KAoSObserver registering with for updates.
deregisterObserver
public void deregisterObserver(java.lang.String updateType,
java.lang.Object updateCondition,
KAoSObserver observer)
- Deregister the given KAoSObserver for the given update type from the registry of observers associated with this KAoSObservable.
- Specified by:
deregisterObserver
in interface KAoSObservable
- Parameters:
updateType
- String indicating type of update the KAoSObserver is no longer interested in. For now the DS would handle only KAoSConstants.REGISTRATION_UPDATE.updateCondition
- See the same in the method heading for registerObserver.observer
- the KAoSObserver deregistering.
notify
public void notify(java.lang.String updateType,
java.lang.Object updateCondition,
java.lang.Object update)
- Notify observers interested in the given updateType wiht the given update object.
- Specified by:
notify
in interface KAoSObservable
- Parameters:
updateType
- String describing the type of update to perform. For now the DS would handle only KAoSConstants.REGISTRATION_UPDATE.updateCondition
- See the same in the method heading for registerObserver.update
- Object containing the update. For now this is the agent description of the matching agent. Please note that if the observer has registered for 'AGENT_LIST', then
it will initially get a list of all agent descriptions, and afterwards will keep getting individual descriptions as new agents come online. If it has not
registered for AGENT_LIST, then it will descriptions of all matching agents seperately (i.e. not all in one list) and then will keep getting individual
descriptions as new agents come online.
isObserverRegisteredForCondition
protected boolean isObserverRegisteredForCondition(java.lang.String updateType,
java.lang.Object condition)