public class MRuleExecutionSetWrapper extends Object implements IMRuleExecutionSet, IMruleExecutionSet, ICallableRepository, IExecutable.ValueReturning
IExecutable.ValueReturning
Constructor and Description |
---|
MRuleExecutionSetWrapper(IMRuleExecutionSet wrapped) |
Modifier and Type | Method and Description |
---|---|
IExecutionResult |
call(String name,
IExecutionContext ctxt)
Requests call to the
ICallable identified by its name inside the repository. |
IMRuleExecutionSet |
clone()
Clones the IExecutable.
|
void |
compile(ICompilationContext ctxt)
Compiles the IExecutable to precompute data, ensure that future executions will work, etc ...
|
boolean |
equals(Object obj) |
IExecutionResult |
execute(IExecutionContext ctxt)
General contract for all RuleExecutionSet implementations.
|
MBeanUtils.ImportHolder |
generateImports()
Generates "on the fly" the imports, ignoring data produced by the compilation phase.
|
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.
|
CostInfo |
getEstimatedReadCost(ICompilationContext ctxt)
This kind of executable should provide a cost estimation in order to be used as accessor
and be optimized effectively.
|
CostInfo |
getEstimatedReadCost(String name,
ICompilationContext ctxt)
Computes an estimated cost of the whole callable execution, in order to be able to
optimize accurately.
|
String |
getImplementationId()
Unique addon implementation ID.
|
MBeanUtils.ImportHolder |
getImports()
Returns local imports for this ruleset.
|
Integer |
getInternalCacheIdentifier()
This method allows to retrieve the internal cache identifier set during the compilation phase.
|
int |
getInternalDistinctAddonCacheCount() |
MRuleExecutionSetMetadata |
getMetadata() |
String |
getName()
Retrieves the name of the current instance.
|
Map<Object,Object> |
getProperties()
Get all properties.
|
Object |
getProperty(Object arg0) |
List<? extends IExecutable> |
getRules() |
String |
getUri() |
IMRuleExecutionSet |
getWrapped() |
int |
hashCode() |
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()
Tells if this addon will or not use cached data.
|
boolean |
isCompiled()
Tells whether the mandatory compilation step has been executed or not.
|
boolean |
isInternalCacheIdentifierNeeded()
This method allows to tell the engine if a cache identifier is needed.
|
void |
optimize(ICompilationContext ctxt)
Called automatically at the end of the compilation process on all addons,
allows an addon to perform internal optimization depending on data computed by all other addons during compilation process.
|
void |
removeProperty(Object key)
Removing property.
|
void |
resetCachedData(IExecutionContext ctxt)
Tells this addon to reset its cached data, if any.
|
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 arg0) |
void |
setDescription(String description)
Sets the description of the current instance.
|
void |
setInternalCacheIdentifier(Integer internalIdentifier)
This method is called internally during the compilation phase, to set an internal cache identifier.
|
void |
setName(String name)
Sets the name of the current instance.
|
void |
setProperty(Object arg0,
Object arg1) |
void |
setUri(String uri)
Set unique ruleset URI
|
void |
setWrapped(IMRuleExecutionSet wrapped) |
String |
toString() |
void |
toString(OuterWithLevel outer)
Method used to send String representation of the current object to the
OuterWithLevel . |
boolean |
validate(String name)
Validates that the named
ICallable exists in this repository. |
boolean |
wasRegistered(ICompilationContext ctxt,
IAddon parent,
AddonInfo info)
Hook called when addon is registered in context.
|
public MRuleExecutionSetWrapper(IMRuleExecutionSet wrapped)
public IMRuleExecutionSet getWrapped()
public void setWrapped(IMRuleExecutionSet wrapped)
public void compile(ICompilationContext ctxt) throws MRuleValidationException
IExecutable
compile
in interface IExecutable
MRuleValidationException
- if validation problem detected.public IExecutionResult execute(IExecutionContext ctxt) throws MExecutionException
IMRuleExecutionSet
execute
in interface IExecutable
execute
in interface IMRuleExecutionSet
ExecutionResultState.combineConditionState(ExecutionResultState)
) :
ExecutionResultState.combineActionState(ExecutionResultState)
) :
MConditionEvaluationException
MActionExecutionException
MExecutionException
public void removeProperty(Object key)
IExecutable
removeProperty
in interface IExecutable
public boolean hasProperty(Object key)
IExecutable
hasProperty
in interface IExecutable
public boolean hasProperties()
IExecutable
hasProperties
in interface IExecutable
public Map<Object,Object> getProperties()
IExecutable
getProperties
in interface IExecutable
public String getImplementationId()
IAddon
getImplementationId
in interface IAddon
public void optimize(ICompilationContext ctxt) throws MRuleValidationException
IAddon
optimize
in interface IAddon
MRuleValidationException
public void setInternalCacheIdentifier(Integer internalIdentifier)
IAddon
setInternalCacheIdentifier
in interface IAddon
internalIdentifier
- Internal identifierIAddon.getInternalCacheIdentifier()
public Integer getInternalCacheIdentifier()
IAddon
getInternalCacheIdentifier
in interface IAddon
IAddon.setInternalCacheIdentifier(Integer)
public boolean isInternalCacheIdentifierNeeded()
IAddon
IAddon.isCacheUsed()
), but the optimization
process can identify that the cache is not necessary in some cases. To deactivate it, at this point,
the optimizer can't modify the value returned by IAddon.isCacheUsed()
, but only the value returned
by IAddon.isInternalCacheIdentifierNeeded()
.isInternalCacheIdentifierNeeded
in interface IAddon
IAddon.setInternalCacheIdentifier(Integer)
public boolean isCacheUsed()
IAddon
IAddon.isInternalCacheIdentifierNeeded()
.isCacheUsed
in interface IAddon
public void resetCachedData(IExecutionContext ctxt)
IAddon
IExecutionContext.resetCachedData(IAddon)
, so to tell
an addon instance to reset its cached data, this method should be called, not the one in IExecutionContext.resetCachedData
in interface IAddon
public boolean wasRegistered(ICompilationContext ctxt, IAddon parent, AddonInfo info) throws MRuleValidationException
IAddon
wasRegistered
in interface IAddon
parent
- Parent from which this instance of addon was registered.info
- Addon info for the currently registered addonMRuleValidationException
public void toString(OuterWithLevel outer) throws IOException
Outable
OuterWithLevel
.toString
in interface Outable
IOException
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 String getDebugInfo()
IMRulesObject
getDebugInfo
in interface IMRulesObject
public void setDebugInfo(String debugInfo)
IMRulesObject
setDebugInfo
in interface IMRulesObject
public Object getProperty(Object arg0)
getProperty
in interface javax.rules.admin.Rule
getProperty
in interface javax.rules.admin.RuleExecutionSet
public void setProperty(Object arg0, Object arg1)
setProperty
in interface javax.rules.admin.Rule
setProperty
in interface javax.rules.admin.RuleExecutionSet
public String getDefaultObjectFilter()
getDefaultObjectFilter
in interface javax.rules.admin.RuleExecutionSet
public List<? extends IExecutable> getRules()
getRules
in interface javax.rules.admin.RuleExecutionSet
public void setDefaultObjectFilter(String arg0)
setDefaultObjectFilter
in interface javax.rules.admin.RuleExecutionSet
public boolean isCompiled()
IMRuleExecutionSet
isCompiled
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 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 IContextFactory getContextFactory()
getContextFactory
in interface IMRuleExecutionSet
public void setContextFactory(IContextFactory contextFactory)
setContextFactory
in interface IMRuleExecutionSet
public int getInternalDistinctAddonCacheCount()
getInternalDistinctAddonCacheCount
in interface IMRuleExecutionSet
public MBeanUtils.ImportHolder getImports()
IMRuleExecutionSet
getImports
in interface IMRuleExecutionSet
public MBeanUtils.ImportHolder generateImports()
IMRuleExecutionSet
generateImports
in interface IMRuleExecutionSet
public IMRuleExecutionSet clone()
IExecutable
clone
in interface IAddon
clone
in interface IMRulesObject
clone
in interface IExecutable
clone
in interface IMRuleExecutionSet
clone
in class Object
public CostInfo getEstimatedReadCost(ICompilationContext ctxt) throws MRuleValidationException
IExecutable.ValueReturning
getEstimatedReadCost
in interface IExecutable.ValueReturning
MRuleValidationException
public boolean validate(String name)
ICallableRepository
ICallable
exists in this repository.validate
in interface ICallableRepository
name
- Name of the ICallable
to validatepublic IExecutionResult call(String name, IExecutionContext ctxt) throws MExecutionException
ICallableRepository
ICallable
identified by its name inside the repository.call
in interface ICallableRepository
name
- Name of the ICallable
to callctxt
- Execution contextMExecutionException
public CostInfo getEstimatedReadCost(String name, ICompilationContext ctxt) throws MRuleValidationException
ICallableRepository
getEstimatedReadCost
in interface ICallableRepository
ctxt
- Compilation context.MRuleValidationException