|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaos.core.csi.observe.ObserverManagerImpl
public class ObserverManagerImpl
This class implements the Command interface, which defines sending commands to entities
Nested Class Summary | |
---|---|
static class |
ObserverManagerImpl.MyRemoteKAoSObserver
|
Field Summary | |
---|---|
protected static boolean |
__INITIALIZED
|
protected static ObserverManager |
__INSTANCE
|
protected static java.lang.String |
_DEREGISTER_OBSERVER
|
protected Locator |
_myLocator
|
protected java.lang.String |
_nickname
|
protected static java.lang.String |
_NICKNAME_ROOT
|
protected java.util.Hashtable |
_observablesDescriptions
|
protected java.util.Hashtable |
_observers
|
protected QueryRegistration |
_query
|
protected static java.lang.String |
_REGISTER_OBSERVER
|
protected TransportSupport |
_transport
|
protected java.lang.String |
_transportName
|
Constructor Summary | |
---|---|
protected |
ObserverManagerImpl()
|
Method Summary | |
---|---|
void |
assertNotLocatable(boolean exp,
java.lang.String msg)
|
void |
deregisterObserver(KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
KAoSEntityDescription observableDesc)
Deregister the given KAoSObserver from the registry of observers asoociated with the KAoSObservable, whose GUID is given. |
void |
deregisterObserver(KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
java.lang.String observableGUID)
Deregister the given KAoSObserver from the registry of observers asoociated with the KAoSObservable, whose GUID is given. |
boolean |
equals(java.lang.Object obj)
Two agents are equal if their respective hash codes are equal. |
java.lang.String |
getID()
|
static ObserverManager |
getInstance(java.lang.String transportName)
Retrieve an instance of ObserverManager. |
static ObserverManager |
getInstance(java.lang.String transportName,
java.lang.String nickName)
Retrieve a reference to the ObserverManager. |
int |
hashCode()
Determines the hash code for the AgentUsecase. |
protected void |
initialize(java.lang.String transportName,
java.lang.String nickName)
|
static void |
main(java.lang.String[] args)
|
protected void |
printDebugString(java.lang.String msg,
int loggerDisplayLevel)
|
void |
receiveMessage(TransportMessage tmsg)
Implements the receiveMessage method mandated by the MessageListener interface. |
void |
registerKAoSExtensionComponentObserver(java.lang.String repType,
java.lang.String ontType,
KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
KAoSEntityDescription entityDesc)
Register the given KAoSObserver with the KAoSObservable, whose KAoSEntityDescription is given, for updates described by the updateType and updateConstraints. |
void |
registerObserver(KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
KAoSEntityDescription observableDesc)
Register the given KAoSObserver with the KAoSObservable, whose KAoSEntityDescription is given, for updates described by the updateType and updateConstraints. |
void |
registerObserver(KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
java.lang.String observableGUID)
Register the given KAoSObserver with the KAoSObservable, whose GUID is given for updates described by the updateType and updateConditions. |
void |
registerObserver(KAoSObserver observer,
java.lang.String updateType,
java.io.Serializable updateCondition,
java.lang.String observableGUID,
java.lang.String brokerGUID)
Register the given KAoSObserver with the KAoSObservable, whose GUID is given for updates described by the updateType and updateConditions. |
protected MethodCallResultMsg |
satisfyRequest(MethodCallRequestMsg requestMsg)
|
void |
updateObserver(java.lang.String observerID,
java.lang.String observableID,
java.lang.String updateType,
java.lang.Object updateCondition,
java.lang.Object update)
Receive an update from MyRemoteKAoSObserver |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final ObserverManager __INSTANCE
protected static boolean __INITIALIZED
protected static final java.lang.String _NICKNAME_ROOT
protected static final java.lang.String _REGISTER_OBSERVER
protected static final java.lang.String _DEREGISTER_OBSERVER
protected Locator _myLocator
protected java.lang.String _nickname
protected QueryRegistration _query
protected TransportSupport _transport
protected java.lang.String _transportName
protected java.util.Hashtable _observers
protected java.util.Hashtable _observablesDescriptions
Constructor Detail |
---|
protected ObserverManagerImpl()
Method Detail |
---|
public static ObserverManager getInstance(java.lang.String transportName) throws java.lang.Exception
java.lang.Exception
public static ObserverManager getInstance(java.lang.String transportName, java.lang.String nickName) throws java.lang.Exception
transportName
- is a String containing the name of the transport to use by the ObserverManager.nickName
- is a String containing the nick name of the ObserverManager that may be used by certain
transport implementations, or null if not required by the transport.
java.lang.Exception
public void registerObserver(KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, java.lang.String observableGUID) throws NotLocatableException, TransportFailure
registerObserver
in interface ObserverManager
observer
- KAoSObserver requesting registration for updates.updateType
- String indicating type of update the KAoSObserver is interested in.updateCondition
- Serializable describing the conditions under which to send the update.observableGUID
- String containing the GUID of the KAoSObservable to register with.
NotLocatableException
- when the KAoSObservable cannot be located.
TransportFailure
- when transport services fails.public void registerKAoSExtensionComponentObserver(java.lang.String repType, java.lang.String ontType, KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, KAoSEntityDescription entityDesc) throws NotLocatableException, TransportFailure
registerKAoSExtensionComponentObserver
in interface ObserverManager
observer
- KAoSObserver registering with for updates.updateType
- String indicating type of update the KAoSObserver is interested in.updateCondition
- Object describing the conditions under which to send the update.
NotLocatableException
- when the KAoSObservable cannot be located.
TransportFailure
- when transport services fail.public void registerObserver(KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, KAoSEntityDescription observableDesc) throws NotLocatableException, TransportFailure
registerObserver
in interface ObserverManager
observer
- KAoSObserver registering with for updates.updateType
- String indicating type of update the KAoSObserver is interested in.updateCondition
- Object describing the conditions under which to send the update.observableDesc
- KAoSEntityDescription describing the observable.
NotLocatableException
- when the KAoSObservable cannot be located.
TransportFailure
- when transport services fail.public void registerObserver(KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, java.lang.String observableGUID, java.lang.String brokerGUID) throws NotLocatableException, TransportFailure
registerObserver
in interface ObserverManager
observer
- KAoSObserver requesting registration for updates.updateType
- String indicating type of update the KAoSObserver is interested in.updateCondition
- Serializable describing the conditions under which to send the update.observableGUID
- String containing the GUID of the KAoSObservable to register with.brokerGUID
- String containing the GUID of the broker, through which
NotLocatableException
- when the KAoSObservable or broker cannot be located.
TransportFailure
- when transport services fail.
the rgistration will be processed.public void deregisterObserver(KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, java.lang.String observableGUID) throws NotLocatableException, TransportFailure
deregisterObserver
in interface ObserverManager
observer
- KAoSObserver deregistering.updateType
- String indicating type of update the KAoSObserver is no longer interested in.updateCondition
- Serializable containing the condition the KAoSObserver is no longer interested in.observableGUID
- String specifying the GUID of the observable, from which to deregister
for the given update type.
NotLocatableException
- when the KAoSObservable cannot be located.
TransportFailure
- when transport services fail.public void deregisterObserver(KAoSObserver observer, java.lang.String updateType, java.io.Serializable updateCondition, KAoSEntityDescription observableDesc) throws NotLocatableException, TransportFailure
deregisterObserver
in interface ObserverManager
observer
- KAoSObserver deregistering.updateType
- String indicating type of update the KAoSObserver is no longer interested in.updateCondition
- Serializable containing the condition the KAoSObserver is no longer interested in.observableDesc
- KAoSEntityDescription of the observable, from which to deregister
for the given update type.
NotLocatableException
- when the KAoSObservable cannot be located.
TransportFailure
- when transport services fail.public void receiveMessage(TransportMessage tmsg)
MessageListener
,
TransportMessage
,
"JAS Specification, Section(s) 3.4.2, 4.7.2"public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
hashCode()
,
"JAS Specification, Section(s) 4.7.2"public int hashCode()
super.hashCode()
.
hashCode
in class java.lang.Object
Object.hashCode()
,
"JAS Specification, Section(s) 4.7.2"public void updateObserver(java.lang.String observerID, java.lang.String observableID, java.lang.String updateType, java.lang.Object updateCondition, java.lang.Object update)
observerID
- The ID of the observer to informobservableID
- String identifying the KAoSObservable sending the update.updateType
- String indicating type of update.updateCondition
- Object indicating the update condition.update
- Object containing the update.public java.lang.String getID()
protected MethodCallResultMsg satisfyRequest(MethodCallRequestMsg requestMsg)
protected void initialize(java.lang.String transportName, java.lang.String nickName) throws java.lang.Exception
java.lang.Exception
public void assertNotLocatable(boolean exp, java.lang.String msg) throws NotLocatableException
NotLocatableException
- if exp is true.protected void printDebugString(java.lang.String msg, int loggerDisplayLevel)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |