|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.hammurapi.util.VisitableBase
biz.hammurapi.config.GenericContainer
biz.hammurapi.config.DomConfigurableContainer
biz.hammurapi.rules.RulesContainerBase
biz.hammurapi.rules.QueueingRulesContainer
public class QueueingRulesContainer
This rules container uses QueuingDispatcher and negation semantics for remove().
It can also leverage worker (thread pool) provided in worker-ref
attribute
for multithreaded inference.
This container also uses loop detection.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface biz.hammurapi.rules.KnowledgeBase |
---|
KnowledgeBase.KnowledgeBaseCommand |
Field Summary |
---|
Fields inherited from interface biz.hammurapi.rules.Constants |
---|
COLLECTION_MANAGER, DESCRIPTION, HANDLE_MANAGER, KNOWLEDGE_COMPACTOR, NAME, NEGATOR_CLASS, OBJECT_FILTER, RETAIN_NEGATORS, RULES, URI_DIRECT, URI_PROPERTY, WORKER_REF |
Constructor Summary | |
---|---|
QueueingRulesContainer()
|
Method Summary | |
---|---|
void |
add(java.lang.Object obj)
Adds object to handle manager and dispatches to rules. |
protected boolean |
checkLoop(java.lang.Object object)
Checks recent conclusions and derivation depth to discard conclusions which came through dispatching too many times or conclusions with too big depth. |
void |
configure(org.w3c.dom.Node configNode,
biz.hammurapi.config.Context context,
java.lang.ClassLoader classLoader)
|
void |
executeRules()
Invokes dispatcher's join() to wait until all jobs are finished. |
protected java.util.Collection |
getObjectActions(java.lang.Object obj)
Returns actions performed when object was added to the database. |
java.util.Collection |
getRules()
|
protected Negator |
newNegator(java.lang.Object obj)
Instantiates new negator. |
protected void |
onDiscardedConclusion(Conclusion conclusion)
Conclusions discarded because their derivation depth is too big are passed to this method. |
protected void |
onDispatchException(DispatchException exception)
Consumes DispatchException. |
void |
remove(java.lang.Object obj)
Removes object from handle manager and recent facts. |
void |
reset()
Resets rules state (if any). |
void |
start()
|
void |
stop()
|
Methods inherited from class biz.hammurapi.rules.RulesContainerBase |
---|
getComponentName |
Methods inherited from class biz.hammurapi.config.GenericContainer |
---|
acceptChildren, addComponent, addMeasurement, execute, get, getAttribute, getComponentMap, getComponentNames, getComponents, getMeasurementConsumer, getOwner, removeAttribute, setAttribute, setMeasurementConsumer, setOwner |
Methods inherited from class biz.hammurapi.util.VisitableBase |
---|
accept, convert2searchable, find, findAll, object2visitor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueueingRulesContainer()
Method Detail |
---|
public void add(java.lang.Object obj)
add
in interface KnowledgeBase
protected void onDispatchException(DispatchException exception)
exception
- protected boolean checkLoop(java.lang.Object object)
object
-
protected void onDiscardedConclusion(Conclusion conclusion)
conclusion
- public void remove(java.lang.Object obj)
remove
in interface KnowledgeBase
protected java.util.Collection getObjectActions(java.lang.Object obj)
obj
-
protected Negator newNegator(java.lang.Object obj)
obj
-
public void executeRules()
executeRules
in interface KnowledgeBase
public void configure(org.w3c.dom.Node configNode, biz.hammurapi.config.Context context, java.lang.ClassLoader classLoader) throws biz.hammurapi.config.ConfigurationException
configure
in interface biz.hammurapi.config.DomConfigurable
configure
in class biz.hammurapi.config.DomConfigurableContainer
biz.hammurapi.config.ConfigurationException
public void start() throws biz.hammurapi.config.ConfigurationException
start
in interface biz.hammurapi.config.Component
start
in class biz.hammurapi.config.GenericContainer
biz.hammurapi.config.ConfigurationException
public void stop() throws biz.hammurapi.config.ConfigurationException
stop
in interface biz.hammurapi.config.Component
stop
in class biz.hammurapi.config.GenericContainer
biz.hammurapi.config.ConfigurationException
public void reset()
KnowledgeBase
reset
in interface KnowledgeBase
public java.util.Collection getRules()
getRules
in interface KnowledgeBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |