|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkingMemory
A knowledge session for a RuleBase
.
Method Summary | |
---|---|
void |
addEventListener(WorkingMemoryEventListener listener)
Add an event listener. |
FactHandle |
assertObject(Object object)
Assert a fact. |
FactHandle |
assertObject(Object object,
boolean dynamic)
Assert a fact registering JavaBean PropertyChangeListeners
on the Object to automatically trigger modifyObject calls
if dynamic is true . |
void |
clearAgenda()
Clear the Agenda |
boolean |
containsObject(FactHandle handle)
Determine if an object is associated with a FactHandle . |
void |
fireAllRules()
Fire all items on the agenda until empty. |
void |
fireAllRules(AgendaFilter agendaFilter)
Fire all items on the agenda until empty, using the given AgendaFiler |
Object |
getApplicationData(String name)
Retrieve a specific piece of application data by name |
Map |
getApplicationDataMap()
Retrieve all of the set application data in this memory |
List |
getEventListeners()
Returns all event listeners. |
FactHandle |
getFactHandle(Object object)
Retrieve the FactHandle associated with an Object. |
List |
getFactHandles()
Retrieve all known Fact Handles. |
Object |
getObject(FactHandle handle)
Retrieve the object associated with a FactHandle . |
List |
getObjects()
Retrieve all known objects. |
List |
getObjects(Class objectClass)
Retrieve all known objects of the specified class. |
RuleBase |
getRuleBase()
Retrieve the RuleBase of this working memory. |
void |
modifyObject(FactHandle handle,
Object object)
Modify a fact. |
void |
removeEventListener(WorkingMemoryEventListener listener)
Remove an event listener. |
void |
retractObject(FactHandle handle)
Retract a fact. |
void |
setApplicationData(String name,
Object value)
Set a specific piece of application data in this working memory |
void |
setAsyncExceptionHandler(AsyncExceptionHandler handler)
Sets the AsyncExceptionHandler to handle exceptions thrown by the Agenda Scheduler used for duration rules. |
Method Detail |
---|
void addEventListener(WorkingMemoryEventListener listener)
listener
- The listener to add.void removeEventListener(WorkingMemoryEventListener listener)
listener
- The listener to remove.List getEventListeners()
Map getApplicationDataMap()
void setApplicationData(String name, Object value)
name
- the name under which to populate the datavalue
- the application dataObject getApplicationData(String name)
RuleBase getRuleBase()
RuleBase
of this working memory.
RuleBase
.void fireAllRules() throws FactException
FactException
- If an error occurs.void fireAllRules(AgendaFilter agendaFilter) throws FactException
FactException
- If an error occurs.Object getObject(FactHandle handle) throws NoSuchFactObjectException
FactHandle
.
handle
- The fact handle.
NoSuchFactObjectException
- If no object is known to be associated with the specified
handle.containsObject(org.drools.FactHandle)
FactHandle getFactHandle(Object object) throws NoSuchFactHandleException
FactHandle
associated with an Object.
object
- The object.
NoSuchFactHandleException
- If no handle is known to be associated with the specified
object.containsObject(org.drools.FactHandle)
List getObjects()
List getObjects(Class objectClass)
objectClass
- The class of object to return.
List getFactHandles()
boolean containsObject(FactHandle handle)
FactHandle
.
handle
- The fact handle.
true
if an object is known to be associated with
the specified handle, otherwise false
.FactHandle assertObject(Object object) throws FactException
object
- The fact object.
FactException
- If an error occurs.FactHandle assertObject(Object object, boolean dynamic) throws FactException
PropertyChangeListeners
on the Object to automatically trigger modifyObject
calls
if dynamic
is true
.
object
- The fact object.dynamic
- true if Drools should add JavaBean
PropertyChangeListeners
to the object.
FactException
- If an error occurs.void retractObject(FactHandle handle) throws FactException
handle
- The fact-handle associated with the fact to retract.
FactException
- If an error occurs.void modifyObject(FactHandle handle, Object object) throws FactException
handle
- The fact-handle associated with the fact to modify.object
- The new value of the fact.
FactException
- If an error occurs.void setAsyncExceptionHandler(AsyncExceptionHandler handler)
handler
- void clearAgenda()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |