|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Java interface for rule implementations. RuleImplementors are the objects
that provide the actual behavior of the rules. When a Rule is fired for the first time
it will create an instance of its RuleImplementor class using the default constructor. Then
the init(Object[],String[],String,IRuleCopy)
method is called, passing
the initialization parameters defined for the Rule. Then the
fire(TriggerPoint,Object,IRuleCopy,Object[])
method is called to elicit the
RuleImplementor's behavior.
The init
method is called before the
fire
method is called for the first time.
Once the RuleImplementor is instantiated, the Rule caches it so that it doesn't have
to be created and initialized again the next time that Rule is fired. On subsequent fires,
only the RuleImplementor's fire
method is called, not its init
method. Thus the RuleImplementor is generally initialized only once but can be fired many times.
In some scenarios, the method fire
may be called from multiple processes
on the same instance of a RuleImplementor
. This will happen if more than one
client triggers the same rule at the same time. The implication of this is that the method
fire
should not change instance attributes of the implementor unless
synchronization of the data being changed is performed.
Method Summary | |
java.lang.Object |
fire(TriggerPoint tp,
java.lang.Object target,
IRuleCopy rule,
java.lang.Object[] firingParms)
Invoke this method to elicit the behavior of the RuleImplementor. |
java.lang.String |
getDescription()
Returns a String describing the RuleImplementor. |
void |
init(java.lang.Object[] initParams,
java.lang.String[] dependentRules,
java.lang.String userDefinedData,
IRuleCopy rule)
Just after a RuleImplementor is instantiated through its parameterless constructor (which is the only way RuleImplementors come into existence), this method is called and passed RuleImplementor-specific parameters. |
Method Detail |
public java.lang.Object fire(TriggerPoint tp, java.lang.Object target, IRuleCopy rule, java.lang.Object[] firingParms) throws BusinessRuleBeansException
tp
- the trigger point which is firing this rule implementor.target
- the target object of the trigger pointrule
- the rule that the implementor is running on behalf offiringParams
- the firing parameters, i.e. those parameters that are passed
to the BRBeans framework at the trigger pointcom.ibm.brb.BusinessRuleBeansException
- Thrown when an error condition is associated
with the fired Rule implementation.public java.lang.String getDescription()
public void init(java.lang.Object[] initParams, java.lang.String[] dependentRules, java.lang.String userDefinedData, IRuleCopy rule) throws BusinessRuleBeansException
initParams
- the parameters needed to initialize this RuleImplementordependentRules
- the names of the dependent rules to this rule; if there are none,
null is passeduserDefinedData
- userDefinedData property from the Rulerule
- the Rule on whose behalf the rule implementor is running
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |