public abstract class AbstractExecutionContext extends AbstractContext implements IExecutionContext
DEFAULT_LOGGER_NAME
Constructor and Description |
---|
AbstractExecutionContext() |
AbstractExecutionContext(IMRuleExecutionSet executionSet) |
AbstractExecutionContext(IMRuleExecutionSet executionSet,
String loggerName) |
AbstractExecutionContext(String loggerName) |
Modifier and Type | Method and Description |
---|---|
protected void |
completeWrapping(AbstractExecutionContext wrapper,
boolean copyVariables)
Completes execution context wrapping after calling super implementation.
|
void |
debug(String msg)
Writes a debug message.
|
void |
debugEntering()
Forces to enter a log sub-phase without logging any message.
|
void |
debugEntering(String msg)
Increments Debug Level : When entering into a sub-phase.
|
void |
debugExiting()
Forces to exit a log sub-phase without logging any message.
|
void |
debugExiting(String msg)
Decreases Debug Level : When exiting from a sub-phase.
|
void |
debugParent(String msg)
Writes a debug message indented once less (if possible).
|
void |
debugSub(String msg)
Writes a debug message indented once more.
|
IExecutionResult |
execute()
Convenience method to execute the MRuleExecutionSet of this context with this context.
|
Object |
getCachedData(IAddon a)
Retrieves data cached by
IExecutionContext.setCachedData(IAddon, Object) . |
ExtPropertySource |
getCachedPropertySource(Object src)
Internal use only: Drastically disminuish memory footprint by caching Property Source Object.
|
ExtPropertySource |
getCachedPropertySource(Object src,
Class<?> defaultSrcType)
Internal use only: Drastically disminuish memory footprint by caching Property Source Object.
|
String |
getDefaultLoggerName() |
Appendable |
getErr()
Gets error stream.
|
String |
getLogSpaces()
Get spaces corresponding to stack level.
|
Integer |
getMaxDebugLevel() |
Appendable |
getOut()
Gets standard stream.
|
String |
getParentLogSpaces()
Get spaces corresponding to stack level indented once less (if possible).
|
Phase |
getPhase()
Returns:
Phase.COMPILE or Phase.OPTIMIZE for ICompilationContext
Phase.EXECUTE for IExecutionContext
|
Class<?> |
getReadBaseType()
Returns
IExecutionContext.getReadBase() class or null. |
IExecutionContext |
getRootContext()
In case of sub context usage, this allows to access the root context.
|
MExecutionContext<Object> |
getSubContextForNewBases(Object newBases)
Gets a new Execution Context instance, modifying the following behaviours :
Read and write bases are the provided newBases
Cache is disabled
|
MInOutExecutionContext<Object,Object> |
getSubContextForNewBases(Object newReadBase,
Object newWriteBase)
Gets a new Execution Context instance, modifying the following behaviours :
Read and write bases are the provided newReadBase and newWriteBase
Cache is disabled
|
MInOutExecutionContext<Object,Object> |
getSubContextForNewVariables()
Gets a new Execution Context instance, modifying the following behaviours :
Variables repository is different
|
String |
getSubLogSpaces()
Get spaces corresponding to stack level indented once more.
|
Class<?> |
getWriteBaseType()
Returns
IExecutionContext.getWriteBase() class or null. |
boolean |
hasCachedData(IAddon a)
Tells if data are cached by
IExecutionContext.setCachedData(IAddon, Object) , included null value. |
void |
init()
INTERNAL USE ONLY: Called by rule engine to initialize and check before execution.
|
boolean |
isDebugEnabled()
Debug is enabled if LOGGER has debug enabled.
|
void |
resetCachedData()
Resets all cached data for all addons.
|
Object |
resetCachedData(IAddon a)
Resets cached data for one addons, returning previously cached data.
|
Object |
setCachedData(IAddon a,
Object o)
Allows to cache data for a given addon.
|
void |
setErr(Appendable err)
Changes error stream, which is System.err by default.
|
void |
setMaxDebugLevel(Integer maxDebugLevel) |
void |
setOut(Appendable out)
Changes standard stream, which is System.out by default.
|
completeWrapping, getExecutionSet, getImports, getLog, getSecurityManager, getVariables, setExecutionSet, setLoggerName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getReadBase, getWriteBase
getExecutionSet, getImports, getLog, getSecurityManager, getVariables, setExecutionSet, setLoggerName
public AbstractExecutionContext()
public AbstractExecutionContext(String loggerName)
public AbstractExecutionContext(IMRuleExecutionSet executionSet)
public AbstractExecutionContext(IMRuleExecutionSet executionSet, String loggerName)
public String getLogSpaces()
IExecutionContext
getLogSpaces
in interface IExecutionContext
public String getSubLogSpaces()
IExecutionContext
getSubLogSpaces
in interface IExecutionContext
public String getParentLogSpaces()
IExecutionContext
getParentLogSpaces
in interface IExecutionContext
public void debugEntering()
IExecutionContext
debugEntering
in interface IExecutionContext
IExecutionContext.debugEntering()
public void debugEntering(String msg)
IExecutionContext
debugEntering
in interface IExecutionContext
IExecutionContext.debugEntering(java.lang.String)
public void debug(String msg)
IExecutionContext
debug
in interface IExecutionContext
IExecutionContext.debug(java.lang.String)
public void debugSub(String msg)
IExecutionContext
debugSub
in interface IExecutionContext
IExecutionContext.debugSub(java.lang.String)
public void debugParent(String msg)
IExecutionContext
debugParent
in interface IExecutionContext
IExecutionContext.debugParent(java.lang.String)
public void debugExiting()
IExecutionContext
debugExiting
in interface IExecutionContext
IExecutionContext.debugExiting()
public void debugExiting(String msg)
IExecutionContext
debugExiting
in interface IExecutionContext
IExecutionContext.debugExiting(java.lang.String)
public boolean isDebugEnabled()
IExecutionContext
isDebugEnabled
in interface IExecutionContext
IExecutionContext.isDebugEnabled()
public IExecutionResult execute() throws MExecutionException
IExecutionContext
execute
in interface IExecutionContext
MExecutionException
IExecutionContext.execute()
public void init() throws MExecutionException
IExecutionContext
init
in interface IExecutionContext
MExecutionException
IExecutionContext.init()
public String getDefaultLoggerName()
getDefaultLoggerName
in class AbstractContext
IExecutionContext.DEFAULT_LOGGER_NAME
public Object getCachedData(IAddon a)
IExecutionContext
IExecutionContext.setCachedData(IAddon, Object)
.getCachedData
in interface IExecutionContext
IExecutionContext.getCachedData(IAddon)
public Object setCachedData(IAddon a, Object o)
IExecutionContext
setCachedData
in interface IExecutionContext
IExecutionContext.setCachedData(IAddon, Object)
public boolean hasCachedData(IAddon a)
IExecutionContext
IExecutionContext.setCachedData(IAddon, Object)
, included null value.hasCachedData
in interface IExecutionContext
IExecutionContext.hasCachedData(IAddon)
public Object resetCachedData(IAddon a)
IExecutionContext
IAddon.resetCachedData(IExecutionContext)
.resetCachedData
in interface IExecutionContext
IExecutionContext.resetCachedData(IAddon)
public void resetCachedData()
IExecutionContext
resetCachedData
in interface IExecutionContext
IExecutionContext.resetCachedData()
public ExtPropertySource getCachedPropertySource(Object src)
IExecutionContext
getCachedPropertySource
in interface IExecutionContext
public ExtPropertySource getCachedPropertySource(Object src, Class<?> defaultSrcType)
IExecutionContext
getCachedPropertySource
in interface IExecutionContext
public Appendable getOut()
getOut
in interface IExecutionContext
IExecutionContext.getOut()
public void setOut(Appendable out)
IExecutionContext.getOut()
public Appendable getErr()
getErr
in interface IExecutionContext
IExecutionContext.getErr()
public void setErr(Appendable err)
IExecutionContext.getErr()
public Class<?> getReadBaseType()
IExecutionContext.getReadBase()
class or null.getReadBaseType
in interface IContext
public Class<?> getWriteBaseType()
IExecutionContext.getWriteBase()
class or null.getWriteBaseType
in interface IContext
public Integer getMaxDebugLevel()
public void setMaxDebugLevel(Integer maxDebugLevel)
public IExecutionContext getRootContext()
IContext
getRootContext
in interface IExecutionContext
getRootContext
in interface IContext
getRootContext
in class AbstractContext
public MInOutExecutionContext<Object,Object> getSubContextForNewVariables()
IExecutionContext
getSubContextForNewVariables
in interface IExecutionContext
public MExecutionContext<Object> getSubContextForNewBases(Object newBases)
IExecutionContext
getSubContextForNewBases
in interface IExecutionContext
public MInOutExecutionContext<Object,Object> getSubContextForNewBases(Object newReadBase, Object newWriteBase)
IExecutionContext
getSubContextForNewBases
in interface IExecutionContext
protected void completeWrapping(AbstractExecutionContext wrapper, boolean copyVariables)