ch.tatool.app.service.exec.impl
Class ExecutionContextImpl

java.lang.Object
  extended by ch.tatool.app.service.exec.impl.ExecutionContextImpl
All Implemented Interfaces:
PropertyHolder, ExecutionContext

public class ExecutionContextImpl
extends Object
implements ExecutionContext

Execution context object This is sort of a one stop shop for elements during execution. All available and required is a available here. Please note that the context can change from one to the next execution, therefore do not cache the object inside the element.

Author:
Michael Ruflin

Constructor Summary
ExecutionContextImpl(ExecutorImpl executor, ExecutionData executionData, DataService dataService, ExecutionDisplay executionDisplay)
           
 
Method Summary
 void clearProperties()
          Clear all properties
 Element getActiveElement()
          Get the active Element.
 Executable getActiveExecutable()
          Get the currently scheduled or executed ExecutableElement.
 DataService getDataService()
           
 List<Element> getElementStack()
          Get the element stack, the stack of elements being executed.
 ExecutionData getExecutionData()
           
 ExecutionDisplay getExecutionDisplay()
           
 Executor getExecutor()
           
 String getId()
           
 Set<String> getKeys()
          Get all properties contained in this holder
 ExecutionPhase getPhase()
           
 Object getProperty(String name)
           
 void removeProperty(String name)
           
 void setPhase(ExecutionPhase executionPhase)
           
 void setProperty(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionContextImpl

public ExecutionContextImpl(ExecutorImpl executor,
                            ExecutionData executionData,
                            DataService dataService,
                            ExecutionDisplay executionDisplay)
Method Detail

getId

public String getId()
Specified by:
getId in interface PropertyHolder

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface PropertyHolder

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface PropertyHolder

removeProperty

public void removeProperty(String name)
Specified by:
removeProperty in interface PropertyHolder

getKeys

public Set<String> getKeys()
Get all properties contained in this holder

Specified by:
getKeys in interface PropertyHolder

clearProperties

public void clearProperties()
Clear all properties

Specified by:
clearProperties in interface PropertyHolder

getPhase

public ExecutionPhase getPhase()
Specified by:
getPhase in interface ExecutionContext

setPhase

public void setPhase(ExecutionPhase executionPhase)

getExecutor

public Executor getExecutor()
Specified by:
getExecutor in interface ExecutionContext

getDataService

public DataService getDataService()
Specified by:
getDataService in interface ExecutionContext

getExecutionDisplay

public ExecutionDisplay getExecutionDisplay()
Specified by:
getExecutionDisplay in interface ExecutionContext

getExecutionData

public ExecutionData getExecutionData()
Specified by:
getExecutionData in interface ExecutionContext

getActiveExecutable

public Executable getActiveExecutable()
Get the currently scheduled or executed ExecutableElement. This object is available between PRE_PROCESS and POST_PROCESS.

Specified by:
getActiveExecutable in interface ExecutionContext
Returns:
the ExecutableElement object or null

getActiveElement

public Element getActiveElement()
Get the active Element.

Specified by:
getActiveElement in interface ExecutionContext

getElementStack

public List<Element> getElementStack()
Get the element stack, the stack of elements being executed. This object is always available, but empty before and including SESSION_START and after and including SESSION_END

Specified by:
getElementStack in interface ExecutionContext
Returns:
the list of elements, beginning with the root element, containing the executable element as last element


Copyright © 2012. All Rights Reserved.