| biz.hammurapi.rules.AbstractRule biz.hammurapi.rules.Rule
Rule | public class Rule extends AbstractRule (Code) | | Base class for rules.
author: Pavel Vlasov |
Inner Class :public interface ChangeDetector | |
Inner Class :class InvocationEntry | |
Inner Class :public interface AcceptInfo | |
Constructor Summary | |
public | Rule() Default constructor. | protected | Rule(String inferMethodName, String removeMethodName, String acceptMethodName) Parameters: inferMethodName - Methods with this name and one or more arguments are invoked when an object of type compatible with one of parameters is posted to the object bus. |
Rule | public Rule()(Code) | | Default constructor.
Uses "infer" for infer methods, "remove" for remove methods,
and "accept" for filters.
|
Rule | protected Rule(String inferMethodName, String removeMethodName, String acceptMethodName)(Code) | | Parameters: inferMethodName - Methods with this name and one or more arguments are invoked when an object of type compatible with one of parameters is posted to the object bus. Parameters: removeMethodName - Single-argument methods with this name will be invoked when rule set's removemethod with compatible type is invoked. Generally rules shall not implement this method because collectionmanager and handle manager take care of removal of the object and conclusions made based on this object fromthe knowledge base. Parameters: acceptMethodName - Methods with this name and two arguments - the first of equal type and the secondof AcceptInfo type are used to filter inputs to infer methods with more than one parameter. Type of the first argument of accept method and corresponding argument of infer must be equal. accept() method's return type must be boolean . |
createJoinHandlers | void createJoinHandlers(Method method, Method[] acceptMethods)(Code) | | Creates handlers for join method
Parameters: method - Join method. Parameters: acceptMethods - accept methods associated with this join method. |
getInvocationCounter | public long getInvocationCounter()(Code) | | Number of invocations. Call of reset() method zeroes the counter. |
getRemoveHandlers | public Collection getRemoveHandlers()(Code) | | Collection of remove handlers. |
newChangeDetector | protected ChangeDetector newChangeDetector(Object obj)(Code) | | Creates default change detector, which detects changes in versioned and observable objects.
Subclasses can override this method to detect changes as appropriate for the application
domain.
Parameters: obj - Change detector or null if change detection is not needed. |
post | protected void post(Object fact)(Code) | | Adds new fact to knowledge base.
Returning value from inference methods has the same effect.
Parameters: fact - |
remove | protected void remove(Object fact)(Code) | | Invokes remove method of the knowledge base and adds trace action.
|
reset | public void reset()(Code) | | |
resetInvocationCounter | protected long resetInvocationCounter()(Code) | | Resets invocation counter.
counter value before reset. |
start | public void start() throws ConfigurationException(Code) | | Locates collection manager.
|
|
|