public interface IControllerContext
The controller context is a map of key-value pairs, attached to an initialized
Controller
instance. The context is created in
Controller.init()
methods and remains valid until
Controller.dispose()
is invoked.
The context instance is passed to all components that take part in query processing
inside the controller object (IProcessingComponent.init(IControllerContext)
).
IProcessingComponent
implementations may use the context object to store data
shared between all component instances (such as thread pools, counters, etc.).
In such scenario it is essential to remember to attach a
IControllerContextListener
and clean up any resources when the controller is
destroyed.
Modifier and Type | Method and Description |
---|---|
void |
addListener(IControllerContextListener listener)
Adds a
IControllerContextListener to this context. |
Object |
getAttribute(String key)
Atomically retrieves the value for a given key.
|
void |
removeListener(IControllerContextListener listener)
Removes a
IControllerContextListener from this context. |
void |
setAttribute(String key,
Object value)
Atomically binds the given key to the value.
|
void setAttribute(String key, Object value)
Object getAttribute(String key)
void addListener(IControllerContextListener listener)
IControllerContextListener
to this context.void removeListener(IControllerContextListener listener)
IControllerContextListener
from this context.