Interface Operator.SharedObjectManager

Enclosing class:
Operator

public static interface Operator.SharedObjectManager
The manager for SharedObjects within a container. Used in the Operator.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 during registerSharedObject(java.lang.Object, com.streambase.sb.operator.Operator.SharedObject).
Since:
7.1 initial release
  • Method Details

    • 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 SharedObject
      value - the SharedObject
      Throws:
      IllegalArgumentException - if there has already been a SharedObject registered with the given key
      AlreadyRegisteredException - throw if the SharedObject is already registered
      StreamBaseException - thrown by calling the SharedObject.start()
      See Also:
    • 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:
    • 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:
    • getSharedObjectState

      Operator.SharedObject.State getSharedObjectState(Object key)
      Return the Operator.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: