|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.websphere.brb.strategy.DefaultNonClassifierFindingStrategy
The default FindingStrategy which is used to find non-classifier rules. No other types of rules are
found by this FindingStrategy. Clients wishing to write their own finding strategies can use it
as the basis for their implementation. The client programmer should subclass
DefaultClassifierFindingStrategy to implement a custom strategy. Normally new behavior
should be implemented by overriding one or more of the following methods: parseRuleIdInfo
,
find...RulesInCache
, find...RulesInDatabase
, and
add...RulesToCache
. The default findRules
method should usually be
adequate. Note that, since the finding strategy is stored as part of the TriggerPoint and
the TriggerPoint may be passed on a remote method call to the rule when it is fired, any
FindingStrategy implementation must implement the Serializable interface.
Fields inherited from interface com.ibm.websphere.brb.FindingStrategy |
DEFAULT_CLASSIFIER, DEFAULT_NONCLASSIFIER |
Constructor Summary | |
DefaultNonClassifierFindingStrategy()
|
Method Summary | |
void |
addClassifiedRulesToCache(IRule[] rulesToAdd,
java.lang.String folderName,
java.lang.String ruleName,
TriggerPoint tp,
java.lang.String[] classifications,
java.util.Date asOfDate)
Add the specified classified rules to the cache. |
void |
addUnclassifiedRulesToCache(IRule[] rulesToAdd,
java.lang.String folderName,
java.lang.String ruleName,
TriggerPoint tp,
java.util.Date asOfDate)
Add the specified unclassified rules to the cache. |
IRule[] |
findClassifiedRulesInCache(java.lang.String folderName,
java.lang.String ruleName,
TriggerPoint tp,
java.lang.String[] classifications,
java.util.Date asOfDate)
Look in the cache for classified rules with the specified name in the specified folder that are in effect on the specified date. |
IRule[] |
findClassifiedRulesInDatabase(java.lang.String folderName,
java.lang.String ruleName,
TriggerPoint tp,
java.lang.String[] classifications,
java.util.Date date)
Look in the database for classifed rules with the specified name in the specified folder that are in effect on the specified date. |
IRule[] |
findRules(TriggerPoint tp,
java.lang.Object ruleIdInfo,
java.lang.Object classificationInfo,
java.util.Date asOfDate)
This implementation of the findRules method searches for non-classifier rules matching
the specified criteria. |
IRule[] |
findUnclassifiedRulesInCache(java.lang.String folderName,
java.lang.String ruleName,
TriggerPoint tp,
java.util.Date asOfDate)
Look in the cache for unclassified rules with the specified name in the specified folder that are in effect on the specified date. |
IRule[] |
findUnclassifiedRulesInDatabase(java.lang.String folderName,
java.lang.String ruleName,
TriggerPoint tp,
java.util.Date date)
Look in the database for unclassifed rules with the specified name in the specified folder that are in effect on the specified date. |
java.lang.String[] |
parseClassificationInfo(java.lang.Object classificationInfo)
Uses the classification information object passed into the finding strategy to determine the classifications of the rules to be found. |
java.lang.String[] |
parseRuleIdInfo(java.lang.Object ruleIdInfo,
java.lang.String baseFolderName)
Uses the rule ID information object passed into the finding strategy to determine the fully-qualified names of the rules to be found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultNonClassifierFindingStrategy()
Method Detail |
public void addClassifiedRulesToCache(IRule[] rulesToAdd, java.lang.String folderName, java.lang.String ruleName, TriggerPoint tp, java.lang.String[] classifications, java.util.Date asOfDate) throws BusinessRuleBeansException
Add the specified classified rules to the cache. The rules will be associated with the
specified folder name, rule name, classifications, and asOfDate. This implementation simply
calls a helper method to add the rules to the BRBeans-supplied cache. Users may add to or otherwise
change this behavior by overriding this method. If this method is overridden, the
findClassifiedRulesInCache
method may also need to be overridden.
rulesToAdd
- Array of rules to add to cache.folderName
- The rules will be associated with this folder name in the cache.ruleName
- The rules will be associated with this rule name in the cache.tp
- The TriggerPoint used to make this call.classifications
- The rules will be associated with these classifications in the cache.asOfDate
- The rules will be associated with this asOfDate in the cache. If null, then
the current date and time is used.BusinessRuleBeansException
- If any errors occur.public void addUnclassifiedRulesToCache(IRule[] rulesToAdd, java.lang.String folderName, java.lang.String ruleName, TriggerPoint tp, java.util.Date asOfDate) throws BusinessRuleBeansException
Add the specified unclassified rules to the cache. The rules will be associated with the
specified folder name, rule name, and asOfDate. This implementation simply
calls a helper method to add the rules to the BRBeans-supplied cache. Users may add to or otherwise
change this behavior by overriding this method. If this method is overridden, the
findUnclassifiedRulesInCache
method may also need to be overridden.
rulesToAdd
- Array of rules to add to cache.folderName
- The rules will be associated with this folder name in the cache.ruleName
- The rules will be associated with this rule name in the cache.tp
- The TriggerPoint used to make this call.asOfDate
- The rules will be associated with this asOfDate in the cache. If null, then
the current date and time is used.BusinessRuleBeansException
- If any errors occur.public IRule[] findClassifiedRulesInCache(java.lang.String folderName, java.lang.String ruleName, TriggerPoint tp, java.lang.String[] classifications, java.util.Date asOfDate) throws BusinessRuleBeansException
Look in the cache for classified rules with the specified name in the specified folder that are in effect on the specified date. The rule must also be marked as ready and it must be classified with one of the classifications specified. The specified asOfDate may be null which means to look for rules that are in effect at the current date and time.
Note that there are two "no rules found in cache" conditions that must be distinguished:
This implementation simply calls a helper method to find rules in the BRBeans-supplied cache.
Users may add to or otherwise change this behavior by overriding this method. If this method is
overridden, the addClassifiedRulesToCache
method may also need to be overridden.
folderName
- Search for rules in this folder.ruleName
- Search for rules with this name.tp
- The TriggerPoint used to make this call.classifications
- Search for rules with the specified classifications. Assumed to be non-null.asOfDate
- Rules found should be in effect on this date. If null, rules in effect at the
current date and time should be found.BusinessRuleBeansException
- If any errors occur.public IRule[] findClassifiedRulesInDatabase(java.lang.String folderName, java.lang.String ruleName, TriggerPoint tp, java.lang.String[] classifications, java.util.Date date) throws BusinessRuleBeansException
Look in the database for classifed rules with the specified name in the specified folder that are in effect on the specified date. The rule must also be marked as ready and must be classified with one of the specified classifications.
This implementation simply calls a helper method to find rules in the database. Users may add to or otherwise change this behavior by overriding this method.
folderName
- Search for rules in this folder.ruleName
- Search for rules with this name.tp
- The TriggerPoint used to make this call.classifications
- Search for rules with the specified classifications. Assumed to be non-null.date
- Search for rules that are effective on this date.BusinessRuleBeansException
- If any errors occur.public IRule[] findRules(TriggerPoint tp, java.lang.Object ruleIdInfo, java.lang.Object classificationInfo, java.util.Date asOfDate) throws BusinessRuleBeansException
findRules
method searches for non-classifier rules matching
the specified criteria. Only non-classifier (i.e. the rule is either classified or it is neither
classified nor a classifier) rules are found. This method controls the overall flow of events
for the finding strategy. The events consist of the following steps:
parseRuleIdInfo
method).
parseClassificationInfo
method).
findClassifiedRulesInCache
or findUnclassifiedRulesInCache
).
findClassifiedRulesInDatabase
or findUnclassifiedRulesInDatabase
).
addClassifiedRulesToCache
or addUnclassifiedRulesToCache
).
When implementing a custom finding strategy, if this method is overridden, care should be taken that the new implementation fulfills the method's contract. Normally the overall sequence of events defined in this implementation should be adequate and clients should override one or more of the methods listed above in the four steps to implement a custom finding strategy.
findRules
in interface FindingStrategy
com.ibm.websphere.brb.FindingStrategy
tp
- the trigger point which is used to make this callruleIdInfo
- an object that can be used to identify the rules to be found; normally
a fully-qualified name or an array of fully-qualified namesclassificationInfo
- an object that can be used to determine the classification of the rules
to be found, or null for unclassified rulesasOfDate
- rules returned should be in effect as of this date; null means use
the current date and timeBusinessRuleBeansException
- if any exceptions occurpublic IRule[] findUnclassifiedRulesInCache(java.lang.String folderName, java.lang.String ruleName, TriggerPoint tp, java.util.Date asOfDate) throws BusinessRuleBeansException
Look in the cache for unclassified rules with the specified name in the specified folder that are in effect on the specified date. The rule must also be marked as ready an must not be a classifier. The specified asOfDate may be null. This means to look for rules that are in effect at the current date and time.
Note that there are two "no rules found in cache" conditions that must be distinguished:
This implementation simply calls a helper method to find rules in the BRBeans-supplied cache.
Users may add to or otherwise change this behavior by overriding this method. If this method is
overridden, the addUnclassifiedRulesToCache
method may also need to be overridden.
folderName
- Search for rules in this folder.ruleName
- Search for rules with this name.tp
- The TriggerPoint used to make this call.asOfDate
- Rules found should be in effect on this date. If null, rules in effect at the
current date and time should be found.BusinessRuleBeansException
- If any errors occur.public IRule[] findUnclassifiedRulesInDatabase(java.lang.String folderName, java.lang.String ruleName, TriggerPoint tp, java.util.Date date) throws BusinessRuleBeansException
Look in the database for unclassifed rules with the specified name in the specified folder that are in effect on the specified date. The rule must also be marked as ready, must not be a classifier, and must not be classified.
This implementation simply calls a helper method to find rules in the database. Users may add to or otherwise change this behavior by overriding this method.
folderName
- Search for rules in this folder.ruleName
- Search for rules with this name.tp
- The TriggerPoint used to make this call.date
- Search for rules that are effective on this date.BusinessRuleBeansException
- If any errors occur.public java.lang.String[] parseClassificationInfo(java.lang.Object classificationInfo) throws BusinessRuleBeansException
Uses the classification information object passed into the finding strategy to determine the classifications of the rules to be found. Currently BRB will only pass a single String or an Object[] containing Strings as the classification information. If any other type is received by this method, an BusinessRuleBeansException will be thrown. Users can override this method in custom finding strategies to create an array of classifications using a different algorithm.
classificationInfo
- Object containing information to be used to produce an array of
classification Strings. Currrently BRBeans will only pass a single String or an Object[] containing
Strings to the finding strategy. If this parameter is null, then only unclassified rules will be
found.BusinessRuleBeansException
- If any errors occur.public java.lang.String[] parseRuleIdInfo(java.lang.Object ruleIdInfo, java.lang.String baseFolderName) throws BusinessRuleBeansException
Uses the rule ID information object passed into the finding strategy to determine the fully-qualified names of the rules to be found. The ruleIdInfo parameter can be any object that can be used to determine the rule names. It is exactly the rule ID information object passed on the TriggerPoint call. For the BRBeans-supplied finding strategies, this is required to be either a single String (find rules with this fully-qualified name) or a String[] or an Object[] containing Strings (find rules that have any of the fully-qualified names in the array). Any other types will result in an BusinessRuleBeansException being thrown. Users can override this method in their own finding strategies to take any type of parameter, as long as it can be used to produce an array of fully-qualified rule names.
ruleIdInfo
- Object containing information to be used to produce an array of fully-qualified
rule names. BRBeans-supplied finding strategies require that this is either a
String, a String[], or an Object[] containing Strings.baseFolderName
- The base folder name that rule names should be relative to. If null, then
rule names must be fully-qualified.BusinessRuleBeansException
- If any errors occur.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |