com.ibm.websphere.brb.strategy
Class AcceptFirstFilteringStrategy

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

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

Returns only the first rule which is given; if zero rules are given, throws a NoRulesFoundException.

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
AcceptFirstFilteringStrategy()
           
 
Method Summary
 IRule[] filterRules(TriggerPoint tp, IRule[] rules)
          Returns only the first rule which is given; if zero rules are given, throws a NoRulesFoundException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceptFirstFilteringStrategy

public AcceptFirstFilteringStrategy()
Method Detail

filterRules

public IRule[] filterRules(TriggerPoint tp,
                           IRule[] rules)
                    throws BusinessRuleBeansException
Returns only the first rule which is given; if zero rules are given, throws a NoRulesFoundException.

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