com.ibm.websphere.brb.strategy
Class AcceptOneFilteringStrategy

java.lang.Object
  extended bycom.ibm.websphere.brb.strategy.AcceptOneFilteringStrategy
All Implemented Interfaces:
FilteringStrategy, java.io.Serializable

public class AcceptOneFilteringStrategy
extends java.lang.Object
implements FilteringStrategy, java.io.Serializable

Ensures that there is exactly one rule which is found. If zero rules are given, throws a NoRulesFoundException; if multiple rules are found, throws a MultipleRulesFoundException.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.ibm.websphere.brb.FilteringStrategy
ACCEPT_ANY, ACCEPT_FIRST, ACCEPT_LAST, ACCEPT_ONE
 
Constructor Summary
AcceptOneFilteringStrategy()
           
 
Method Summary
 IRule[] filterRules(TriggerPoint tp, IRule[] rules)
          Ensures that there is exactly one rule which is found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceptOneFilteringStrategy

public AcceptOneFilteringStrategy()
Method Detail

filterRules

public IRule[] filterRules(TriggerPoint tp,
                           IRule[] rules)
                    throws BusinessRuleBeansException
Ensures that there is exactly one rule which is found. If zero rules are given, throws a NoRulesFoundException; if multiple rules are found, throws a MultipleRulesFoundException.

Specified by:
filterRules in interface FilteringStrategy
Parameters:
tp - the trigger point which is used to make this call
rules - a list of rules, possibly empty, which this method can modify and return; will not be null
Returns:
An array of Rules which should be fired. If there are no rules to be fired, an array of length zero will be returned.
Throws:
BusinessRuleBeansException - if any exceptions occur