org.apache.beehive.controls.api.context
Class ControlThreadContext

Object
  extended by ControlThreadContext

public class ControlThreadContext
extends Object

The ControlThreadContext class manages the association between ControlContainerContexts and threads of execution. For a given thread of execution, the beginning and ending of contexts will always be nested (never interleaved), so each thread will maintain its own stack of currently executing contexts. This can be used to reassociate with the current active context.


Constructor Summary
ControlThreadContext()
           
 
Method Summary
static void beginContext(ControlContainerContext context)
          Defines the beginning of a new control container execution context.
static void endContext(ControlContainerContext context)
          Ends the current control container execution context
static ControlContainerContext getContext()
          Returns the active ControlContainerContext for the current thread, or null if no context is currently active.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlThreadContext

public ControlThreadContext()
Method Detail

getContext

public static ControlContainerContext getContext()
Returns the active ControlContainerContext for the current thread, or null if no context is currently active.

Returns:
the current active ControlContainerContext

beginContext

public static void beginContext(ControlContainerContext context)
Defines the beginning of a new control container execution context.


endContext

public static void endContext(ControlContainerContext context)
Ends the current control container execution context

Throws:
IllegalStateException - if there is not current active context or it is not the requested context.