| java.lang.Object org.osbl.agent.logic.RuntimeContext
All known Subclasses: org.osbl.agent.logic.ObjectRuntimeContext, org.osbl.agent.logic.TaskRuntimeContext, org.osbl.agent.logic.SubjectRuntimeContext,
RuntimeContext | abstract public class RuntimeContext (Code) | | RuntimeContext subclasses are used at Rule run-time to provide specific context-dependent
functionality in this area. An instance of this class is responsible for two things:
- Populating a RuleContext with all the relevant information needed for Rule run-time.
- Deciding if a given Rule is compatible with an target object candidate.
This latter aspect is useful in case a Rule wants to be applied to a list of objects whose type is not
known in advance. It would guarantee that the Rule is only run on objects for which it makes sense.
In some cases, the target object passed to populate the RuleContext might be a proxy object. The
context-specific implementation should then retrieve the real target object corresponding to the proxy,
and populate the RuleContext with this new object instead.
author: Sebastian Nozzi. |
Method Summary | |
abstract public void | populateRuleContext(RuleContext ruleContext, Object targetOrProxy) Populates ruleContext with at least the target object. | abstract public boolean | ruleIsApplicable(Rule rule, Object targetOrProxy) Tests the applicability of a given Rule can be tested on a target (or proxy) object.
Parameters: rule - the Rule Parameters: targetOrProxy - the target (or proxy) object the Rule will potentially be run on. |
populateRuleContext | abstract public void populateRuleContext(RuleContext ruleContext, Object targetOrProxy)(Code) | | Populates ruleContext with at least the target object.
In case the targetOrProxy object is not the final target, this method is expected
to retrieve it.
Any other information that is populated into the ruleContext is context-dependent.
Parameters: ruleContext - the RuleContext to be populated. Parameters: targetOrProxy - the target (or proxy) object. |
ruleIsApplicable | abstract public boolean ruleIsApplicable(Rule rule, Object targetOrProxy)(Code) | | Tests the applicability of a given Rule can be tested on a target (or proxy) object.
Parameters: rule - the Rule Parameters: targetOrProxy - the target (or proxy) object the Rule will potentially be run on. true, if successful |
|
|