org.oddjob.monitor.model
Class ExplorerContextImpl

java.lang.Object
  extended by org.oddjob.monitor.model.ExplorerContextImpl
All Implemented Interfaces:
ExplorerContext

public class ExplorerContextImpl
extends Object
implements ExplorerContext

Explorer Context. Used to pass useful things down the job hierarchy.

A unique context will exist for each node in the hierarchy but where as the model has specific information about the node in the tree - it's children, is it visable etc, the context contains ancillary informaton about the nodes environment.

Author:
Rob Gordon

Field Summary
static ExplorerContextFactory FACTORY
           
 
Constructor Summary
ExplorerContextImpl(ExplorerModel explorerModel)
          Constructor for the top level context.
 
Method Summary
 ExplorerContext addChild(Object child)
          Add a child context.
 ExplorerContext getParent()
          Get the parent context of this context.
 Object getThisComponent()
          Get the component this is the context for.
 ThreadManager getThreadManager()
           
 Object getValue(String key)
          Get a value from the context.
 void setValue(String key, Object value)
          Set a value in the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY

public static final ExplorerContextFactory FACTORY
Constructor Detail

ExplorerContextImpl

public ExplorerContextImpl(ExplorerModel explorerModel)
Constructor for the top level context.

Method Detail

addChild

public ExplorerContext addChild(Object child)
Description copied from interface: ExplorerContext
Add a child context.

Specified by:
addChild in interface ExplorerContext
Parameters:
child - The component the child is for.
Returns:
A child context for the component.

getThisComponent

public Object getThisComponent()
Description copied from interface: ExplorerContext
Get the component this is the context for.

Specified by:
getThisComponent in interface ExplorerContext
Returns:

getThreadManager

public ThreadManager getThreadManager()
Specified by:
getThreadManager in interface ExplorerContext

getParent

public ExplorerContext getParent()
Description copied from interface: ExplorerContext
Get the parent context of this context.

Specified by:
getParent in interface ExplorerContext
Returns:
The parent, or null if this is the root.

getValue

public Object getValue(String key)
Description copied from interface: ExplorerContext
Get a value from the context.

Specified by:
getValue in interface ExplorerContext
Parameters:
key - The identifier.
Returns:
The value, or null.

setValue

public void setValue(String key,
                     Object value)
Description copied from interface: ExplorerContext
Set a value in the context.

Specified by:
setValue in interface ExplorerContext
Parameters:
key - An identifier for the value.
value - The value.