public abstract class AbstractMRuleExecutionSet extends Object implements IMRulesObject, IMruleExecutionSet, IMRuleExecutionSet
IExecutable.ValueReturning
Constructor and Description |
---|
AbstractMRuleExecutionSet()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
AbstractMRuleExecutionSet |
clone()
Clones the IExecutable.
|
void |
compile(ICompilationContext ctxt)
Launches global compilation process.
|
protected abstract void |
compileRuleSet(ICompilationContext ctxt)
Performs specific compilation actions, including addon registering in context.
|
void |
debugEntering(IExecutionContext ctxt,
IAddon addon)
Overridden to output provided entity.
|
void |
debugExiting(IExecutionContext ctxt,
IAddon addon,
IExecutionResult result)
Overridden to output result and provided output entity.
|
IExecutionResult |
execute(IExecutionContext ctxt)
General contract for all RuleExecutionSet implementations.
|
protected abstract IExecutionResult |
executeRuleSet(IExecutionContext ctxt)
Performs implementation specific execution actions.
|
IContextFactory |
getContextFactory() |
String |
getDebugInfo()
Retrieves some debug information of the current instance.
|
String |
getDefaultObjectFilter() |
javax.rules.ObjectFilter |
getDefaultObjectFilterInstance() |
String |
getDescription()
Retrieves the description of the current instance.
|
Integer |
getInternalCacheIdentifier()
Returns null by default.
|
int |
getInternalDistinctAddonCacheCount() |
MRuleExecutionSetMetadata |
getMetadata() |
String |
getName()
Retrieves the name of the current instance.
|
Map<Object,Object> |
getProperties()
Get all properties.
|
Object |
getProperty(Object key) |
String |
getUri() |
boolean |
hasProperties()
Has at least one property.
|
boolean |
hasProperty(Object key)
Contains the property identified by the provided key.
|
boolean |
isCacheEnabled()
Allows to globally disable cache usage for this ruleset.
|
boolean |
isCacheUsed()
Returns false by default.
|
boolean |
isInternalCacheIdentifierNeeded()
This method allows to tell the engine if a cache identifier is needed.
|
void |
optimize(ICompilationContext ctxt)
Launches global optimization process.
|
protected abstract void |
optimizeRuleSet(ICompilationContext ctxt)
Performs specific optimization actions, including launching the optimization chain.
|
void |
removeProperty(Object key)
Removing property.
|
void |
resetCachedData(IExecutionContext ctxt)
Does nothing.
|
void |
setCacheEnabled(boolean cacheEnabled)
Allows to globally disable cache usage for this ruleset.
|
void |
setContextFactory(IContextFactory contextFactory) |
void |
setDebugInfo(String debugInfo)
Sets some debug information of the current instance.
|
void |
setDefaultObjectFilter(String defaultFilterClazz) |
void |
setDescription(String description)
Sets the description of the current instance.
|
void |
setInternalCacheIdentifier(Integer internalIdentifier)
Stores nothing.
|
void |
setName(String name)
Sets the name of the current instance.
|
void |
setProperty(Object key,
Object value) |
void |
setUri(String uri)
Set unique ruleset URI
|
boolean |
wasRegistered(ICompilationContext ctxt,
IAddon parent,
AddonInfo info)
Does nothing.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateImports, getImports, isCompiled
getImplementationId
public AbstractMRuleExecutionSet()
public final void compile(ICompilationContext ctxt) throws MRuleValidationException
compileRuleSet(ICompilationContext)
, as
this method only initializes and finalizes the phase, core compilation has to be done by implementing classes.compile
in interface IExecutable
MRuleValidationException
- if validation problem detected.protected abstract void compileRuleSet(ICompilationContext ctxt) throws MRuleValidationException
MRuleValidationException
public final void optimize(ICompilationContext ctxt) throws MRuleValidationException
optimizeRuleSet(ICompilationContext)
, as
this method only initializes and finalizes the phase, core optimization has to be done by implementing classes.optimize
in interface IAddon
MRuleValidationException
protected abstract void optimizeRuleSet(ICompilationContext ctxt) throws MRuleValidationException
MRuleValidationException
public final IExecutionResult execute(IExecutionContext ctxt) throws MExecutionException
execute
in interface IExecutable
execute
in interface IMRuleExecutionSet
ExecutionResultState.combineConditionState(ExecutionResultState)
) :
ExecutionResultState.combineActionState(ExecutionResultState)
) :
MConditionEvaluationException
MActionExecutionException
MExecutionException
protected abstract IExecutionResult executeRuleSet(IExecutionContext ctxt) throws MExecutionException
MExecutionException
public boolean wasRegistered(ICompilationContext ctxt, IAddon parent, AddonInfo info)
wasRegistered
in interface IAddon
parent
- Parent from which this instance of addon was registered.info
- Addon info for the currently registered addonpublic void debugEntering(IExecutionContext ctxt, IAddon addon)
public void debugExiting(IExecutionContext ctxt, IAddon addon, IExecutionResult result)
public AbstractMRuleExecutionSet clone()
IExecutable
clone
in interface IAddon
clone
in interface IMRulesObject
clone
in interface IExecutable
clone
in interface IMRuleExecutionSet
clone
in class Object
public final int getInternalDistinctAddonCacheCount()
getInternalDistinctAddonCacheCount
in interface IMRuleExecutionSet
public String getDefaultObjectFilter()
getDefaultObjectFilter
in interface javax.rules.admin.RuleExecutionSet
public void setDefaultObjectFilter(String defaultFilterClazz)
setDefaultObjectFilter
in interface javax.rules.admin.RuleExecutionSet
public javax.rules.ObjectFilter getDefaultObjectFilterInstance() throws MRuleInternalException
getDefaultObjectFilterInstance
in interface IMRuleExecutionSet
MRuleInternalException
public MRuleExecutionSetMetadata getMetadata()
getMetadata
in interface IMRuleExecutionSet
public String getUri()
getUri
in interface IMRuleExecutionSet
public void setUri(String uri)
IMRuleExecutionSet
setUri
in interface IMRuleExecutionSet
public String getDebugInfo()
IMRulesObject
getDebugInfo
in interface IMRulesObject
public void setDebugInfo(String debugInfo)
IMRulesObject
setDebugInfo
in interface IMRulesObject
public String getName()
IMRulesObject
getName
in interface IMRulesObject
getName
in interface javax.rules.admin.Rule
getName
in interface javax.rules.admin.RuleExecutionSet
public void setName(String name)
IMRulesObject
setName
in interface IMRulesObject
public String getDescription()
IMRulesObject
getDescription
in interface IMRulesObject
getDescription
in interface javax.rules.admin.Rule
getDescription
in interface javax.rules.admin.RuleExecutionSet
public void setDescription(String description)
IMRulesObject
setDescription
in interface IMRulesObject
public Object getProperty(Object key)
getProperty
in interface javax.rules.admin.Rule
getProperty
in interface javax.rules.admin.RuleExecutionSet
public void setProperty(Object key, Object value)
setProperty
in interface javax.rules.admin.Rule
setProperty
in interface javax.rules.admin.RuleExecutionSet
public void removeProperty(Object key)
IExecutable
removeProperty
in interface IExecutable
public Map<Object,Object> getProperties()
IExecutable
getProperties
in interface IExecutable
public boolean hasProperty(Object key)
IExecutable
hasProperty
in interface IExecutable
public boolean hasProperties()
IExecutable
hasProperties
in interface IExecutable
public IContextFactory getContextFactory()
getContextFactory
in interface IMRuleExecutionSet
public void setContextFactory(IContextFactory contextFactory)
setContextFactory
in interface IMRuleExecutionSet
public boolean isCacheEnabled()
IMRuleExecutionSet
ICompilationContext.isCacheEnabled(String)
instead.isCacheEnabled
in interface IMRuleExecutionSet
public void setCacheEnabled(boolean cacheEnabled)
IMRuleExecutionSet
setCacheEnabled
in interface IMRuleExecutionSet
public void setInternalCacheIdentifier(Integer internalIdentifier)
setInternalCacheIdentifier
in interface IAddon
internalIdentifier
- Internal identifierIAddon.getInternalCacheIdentifier()
public Integer getInternalCacheIdentifier()
getInternalCacheIdentifier
in interface IAddon
IAddon.setInternalCacheIdentifier(Integer)
public boolean isCacheUsed()
isCacheUsed
in interface IAddon
public void resetCachedData(IExecutionContext ctxt)
resetCachedData
in interface IAddon
public boolean isInternalCacheIdentifierNeeded()
isInternalCacheIdentifierNeeded
in interface IAddon
setInternalCacheIdentifier(Integer)