| java.lang.Object biz.hammurapi.rules.jsr94.RuleSession
RuleSession | class RuleSession implements StatefulRuleSession,StatelessRuleSession(Code) | | Rule session, a facade to internal components.
author: Pavel Vlasov |
Constructor Summary | |
public | RuleSession(Context container, int sessionType, String uri) Wraps container into a session. |
RuleSession | public RuleSession(Context container, int sessionType, String uri) throws RuleSessionCreateException, RuleSessionTypeUnsupportedException(Code) | | Wraps container into a session.
Container shall contain at least the following entries:
/handle-manager of type HandleManager ,
/collection-manager of type CollectionManager ,
/rules with rule subelements,
/name (String),
/description (String).
throws: ConfigurationException - throws: RuleSessionTypeUnsupportedException - |
addObject | public Handle addObject(Object obj)(Code) | | Adds object to handle manager and to knowledge base.
|
addObjects | public List addObjects(List objs)(Code) | | Invokes addObject() for each member of the list and returns collection of handles.
|
containsObject | public boolean containsObject(Handle handle)(Code) | | This call is delegated to handleManager
|
executeRules | public void executeRules()(Code) | | Delegates to knowledgeBase.executeRules(). Normally rules are executed automatically when objects
are added or updated. Invocation of this method may be required in multithreaded inference scenario to make sure that
all threads finished inference process.
|
executeRules | public List executeRules(List objects)(Code) | | Calls executeRules(object, null)
|
executeRules | public List executeRules(List objects, ObjectFilter objectFilter)(Code) | | This method is a wrapper around stateful method.
It adds all objects to the session, executes rules,
returns objects and finally resets the session.
|
getHandles | public List getHandles()(Code) | | List of handles. |
getObject | public Object getObject(Handle handle)(Code) | | Returns object by handle.
|
getObjects | public List getObjects()(Code) | | List of objects filtered by default object filter. |
getObjects | public List getObjects(ObjectFilter filter)(Code) | | List of objects filtered by the filter Parameters: Object - filter, can be null. |
getType | public int getType()(Code) | | Returns session type.
|
release | public void release() throws InvalidRuleSessionException(Code) | | Stops container.
|
removeObject | public void removeObject(Handle handle)(Code) | | Removes object from knowledge base. Knowledge base is
responsible for removal of the object from the handle manager.
|
reset | public void reset()(Code) | | Clears collection manager, handle manager and resets object filter.
|
updateObject | public void updateObject(Handle handle, Object obj)(Code) | | Invokes knowledge base's remove() for the old object, add() for the new object
and rebinds the handle to the new object.
|
|
|