01: package org.osbl.agent.logic;
02:
03: import org.conform.BeanMeta;
04: import org.osbl.agent.model.Rule;
05: import org.osbl.agent.model.RuleContext;
06:
07: /**
08: * The Class ObjectRuntimeContext.
09: *
10: * @author Sebastian Nozzi.
11: */
12: public class ObjectRuntimeContext extends RuntimeContext {
13:
14: /* (non-Javadoc)
15: * @see org.osbl.agent.logic.RuntimeContext#populateRuleContext(org.osbl.agent.model.RuleContext, java.lang.Object)
16: */
17: public void populateRuleContext(RuleContext rtc, Object target) {
18:
19: rtc.setTargetObject(target);
20:
21: BeanMeta beanMeta = new BeanMeta(target.getClass());
22: rtc.put(rtc.BEAN_META, beanMeta);
23: }
24:
25: /* (non-Javadoc)
26: * @see org.osbl.agent.logic.RuntimeContext#ruleIsApplicable(org.osbl.agent.model.Rule, java.lang.Object)
27: */
28: public boolean ruleIsApplicable(Rule rule, Object target) {
29: // We are so generic, all rules are applicable to us
30: return true;
31: }
32:
33: }
|