Package com.streambase.sb.operator
Interface Operator.SharedObjectManager
-
- Enclosing class:
- Operator
public static interface Operator.SharedObjectManager
The manager for SharedObjects within a container. Used in theOperator.RuntimeEnvironment
interface to manage SharedObjects. The lifecycle of a registered SharedObject is maintained by the parent Container. When the parent Container is removed, suspended, resumed the appropriate methods on the SharedObject will also be called. SharedObjects are maintained by the key given duringregisterSharedObject(java.lang.Object, com.streambase.sb.operator.Operator.SharedObject)
.- Since:
- 7.1 initial release
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Operator.SharedObject
getSharedObject(Object key)
get the SharedObject from this Container.Operator.SharedObject.State
getSharedObjectState(Object key)
Return theOperator.SharedObject.State
of SharedObject on this Container associated with the given key or null if there was no mappingvoid
registerSharedObject(Object key, Operator.SharedObject value)
Add the given SharedObject to this Container.Operator.SharedObject
removeSharedObject(Object key)
Remove the SharedObject from this Container.
-
-
-
Method Detail
-
registerSharedObject
void registerSharedObject(Object key, Operator.SharedObject value) throws AlreadyRegisteredException, StreamBaseException
Add the given SharedObject to this Container. Once the SharedObject is added, the Container will be responsible for management of the state of the object. The SharedObject.start() method will be called if the container has been started.- Parameters:
key
- The key that the SharedObjectManager uses to maintain the SharedObjectvalue
- the SharedObject- Throws:
IllegalArgumentException
- if there has already been a SharedObject registered with the given keyAlreadyRegisteredException
- throw if the SharedObject is already registeredStreamBaseException
- thrown by calling the SharedObject.start()- See Also:
Operator.SharedObject
-
getSharedObject
Operator.SharedObject getSharedObject(Object key)
get the SharedObject from this Container.- Parameters:
key
- Object key- Returns:
- the SharedObject associated with this key on this Container or null if there was no mapping
- See Also:
Operator.SharedObject
-
removeSharedObject
Operator.SharedObject removeSharedObject(Object key)
Remove the SharedObject from this Container. Once removed from this Container the user is responsible for state management of the SharedObject.- Parameters:
key
- Object key- Returns:
- the SharedObject associated with this key on this Container or null if there was no mapping
- See Also:
Operator.SharedObject
-
getSharedObjectState
Operator.SharedObject.State getSharedObjectState(Object key)
Return theOperator.SharedObject.State
of SharedObject on this Container associated with the given key or null if there was no mapping- Parameters:
key
- the key for the SharedObject for this Container- Returns:
- The State for the given SharedObject
- See Also:
Operator.SharedObject
-
-