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, setLoggerNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetReadBase, getWriteBasegetExecutionSet, getImports, getLog, getSecurityManager, getVariables, setExecutionSet, setLoggerNamepublic AbstractExecutionContext()
public AbstractExecutionContext(String loggerName)
public AbstractExecutionContext(IMRuleExecutionSet executionSet)
public AbstractExecutionContext(IMRuleExecutionSet executionSet, String loggerName)
public String getLogSpaces()
IExecutionContextgetLogSpaces in interface IExecutionContextpublic String getSubLogSpaces()
IExecutionContextgetSubLogSpaces in interface IExecutionContextpublic String getParentLogSpaces()
IExecutionContextgetParentLogSpaces in interface IExecutionContextpublic void debugEntering()
IExecutionContextdebugEntering in interface IExecutionContextIExecutionContext.debugEntering()public void debugEntering(String msg)
IExecutionContextdebugEntering in interface IExecutionContextIExecutionContext.debugEntering(java.lang.String)public void debug(String msg)
IExecutionContextdebug in interface IExecutionContextIExecutionContext.debug(java.lang.String)public void debugSub(String msg)
IExecutionContextdebugSub in interface IExecutionContextIExecutionContext.debugSub(java.lang.String)public void debugParent(String msg)
IExecutionContextdebugParent in interface IExecutionContextIExecutionContext.debugParent(java.lang.String)public void debugExiting()
IExecutionContextdebugExiting in interface IExecutionContextIExecutionContext.debugExiting()public void debugExiting(String msg)
IExecutionContextdebugExiting in interface IExecutionContextIExecutionContext.debugExiting(java.lang.String)public boolean isDebugEnabled()
IExecutionContextisDebugEnabled in interface IExecutionContextIExecutionContext.isDebugEnabled()public IExecutionResult execute() throws MExecutionException
IExecutionContextexecute in interface IExecutionContextMExecutionExceptionIExecutionContext.execute()public void init()
throws MExecutionException
IExecutionContextinit in interface IExecutionContextMExecutionExceptionIExecutionContext.init()public String getDefaultLoggerName()
getDefaultLoggerName in class AbstractContextIExecutionContext.DEFAULT_LOGGER_NAMEpublic Object getCachedData(IAddon a)
IExecutionContextIExecutionContext.setCachedData(IAddon, Object).getCachedData in interface IExecutionContextIExecutionContext.getCachedData(IAddon)public Object setCachedData(IAddon a, Object o)
IExecutionContextsetCachedData in interface IExecutionContextIExecutionContext.setCachedData(IAddon, Object)public boolean hasCachedData(IAddon a)
IExecutionContextIExecutionContext.setCachedData(IAddon, Object), included null value.hasCachedData in interface IExecutionContextIExecutionContext.hasCachedData(IAddon)public Object resetCachedData(IAddon a)
IExecutionContextIAddon.resetCachedData(IExecutionContext).resetCachedData in interface IExecutionContextIExecutionContext.resetCachedData(IAddon)public void resetCachedData()
IExecutionContextresetCachedData in interface IExecutionContextIExecutionContext.resetCachedData()public ExtPropertySource getCachedPropertySource(Object src)
IExecutionContextgetCachedPropertySource in interface IExecutionContextpublic ExtPropertySource getCachedPropertySource(Object src, Class<?> defaultSrcType)
IExecutionContextgetCachedPropertySource in interface IExecutionContextpublic Appendable getOut()
getOut in interface IExecutionContextIExecutionContext.getOut()public void setOut(Appendable out)
IExecutionContext.getOut()public Appendable getErr()
getErr in interface IExecutionContextIExecutionContext.getErr()public void setErr(Appendable err)
IExecutionContext.getErr()public Class<?> getReadBaseType()
IExecutionContext.getReadBase() class or null.getReadBaseType in interface IContextpublic Class<?> getWriteBaseType()
IExecutionContext.getWriteBase() class or null.getWriteBaseType in interface IContextpublic Integer getMaxDebugLevel()
public void setMaxDebugLevel(Integer maxDebugLevel)
public IExecutionContext getRootContext()
IContextgetRootContext in interface IExecutionContextgetRootContext in interface IContextgetRootContext in class AbstractContextpublic MInOutExecutionContext<Object,Object> getSubContextForNewVariables()
IExecutionContextgetSubContextForNewVariables in interface IExecutionContextpublic MExecutionContext<Object> getSubContextForNewBases(Object newBases)
IExecutionContextgetSubContextForNewBases in interface IExecutionContextpublic MInOutExecutionContext<Object,Object> getSubContextForNewBases(Object newReadBase, Object newWriteBase)
IExecutionContextgetSubContextForNewBases in interface IExecutionContextprotected void completeWrapping(AbstractExecutionContext wrapper, boolean copyVariables)