|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.drools.SynchronizedWorkingMemory
public class SynchronizedWorkingMemory
Each implemented method of the WorkingMemory interface is synchronised.
This class simply delegates each method call to the underlying unsynchronized
WorkingMemoryImpl.
| Constructor Summary | |
|---|---|
SynchronizedWorkingMemory(WorkingMemory workingMemory)
|
|
| Method Summary | |
|---|---|
void |
addEventListener(WorkingMemoryEventListener listener)
Add an event listener. |
FactHandle |
assertObject(java.lang.Object object)
Assert a fact. |
FactHandle |
assertObject(java.lang.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 |
java.lang.Object |
getApplicationData(java.lang.String name)
Retrieve a specific piece of application data by name |
java.util.Map |
getApplicationDataMap()
Retrieve all of the set application data in this memory |
java.util.List |
getEventListeners()
Returns all event listeners. |
FactHandle |
getFactHandle(java.lang.Object object)
Retrieve the FactHandle associated with an Object. |
java.util.List |
getFactHandles()
Retrieve all known Fact Handles. |
java.lang.Object |
getObject(FactHandle handle)
Retrieve the object associated with a FactHandle. |
java.util.List |
getObjects()
Retrieve all known objects. |
java.util.List |
getObjects(java.lang.Class objectClass)
Retrieve all known objects of the specified class. |
RuleBase |
getRuleBase()
Retrieve the RuleBase of this working memory. |
void |
modifyObject(FactHandle handle,
java.lang.Object object)
Modify a fact. |
void |
removeEventListener(WorkingMemoryEventListener listener)
Remove an event listener. |
void |
retractObject(FactHandle handle)
Retract a fact. |
void |
setApplicationData(java.lang.String name,
java.lang.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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SynchronizedWorkingMemory(WorkingMemory workingMemory)
| Method Detail |
|---|
public void addEventListener(WorkingMemoryEventListener listener)
WorkingMemory
addEventListener in interface WorkingMemorylistener - The listener to add.
public FactHandle assertObject(java.lang.Object object,
boolean dynamic)
throws FactException
WorkingMemoryPropertyChangeListeners
on the Object to automatically trigger modifyObject calls
if dynamic is true.
assertObject in interface WorkingMemoryobject - The fact object.dynamic - true if Drools should add JavaBean
PropertyChangeListeners to the object.
FactException - If an error occurs.
public FactHandle assertObject(java.lang.Object object)
throws FactException
WorkingMemory
assertObject in interface WorkingMemoryobject - The fact object.
FactException - If an error occurs.public void clearAgenda()
WorkingMemory
clearAgenda in interface WorkingMemorypublic boolean containsObject(FactHandle handle)
WorkingMemoryFactHandle.
containsObject in interface WorkingMemoryhandle - The fact handle.
true if an object is known to be associated with
the specified handle, otherwise false.
public void fireAllRules()
throws FactException
WorkingMemory
fireAllRules in interface WorkingMemoryFactException - If an error occurs.
public void fireAllRules(AgendaFilter agendaFilter)
throws FactException
WorkingMemory
fireAllRules in interface WorkingMemoryFactException - If an error occurs.public java.lang.Object getApplicationData(java.lang.String name)
WorkingMemory
getApplicationData in interface WorkingMemorypublic java.util.Map getApplicationDataMap()
WorkingMemory
getApplicationDataMap in interface WorkingMemorypublic java.util.List getEventListeners()
WorkingMemory
getEventListeners in interface WorkingMemory
public FactHandle getFactHandle(java.lang.Object object)
throws NoSuchFactHandleException
WorkingMemoryFactHandle associated with an Object.
getFactHandle in interface WorkingMemoryobject - The object.
NoSuchFactHandleException - If no handle is known to be associated with the specified
object.WorkingMemory.containsObject(org.drools.FactHandle)public java.util.List getFactHandles()
WorkingMemory
getFactHandles in interface WorkingMemory
public java.lang.Object getObject(FactHandle handle)
throws NoSuchFactObjectException
WorkingMemoryFactHandle.
getObject in interface WorkingMemoryhandle - The fact handle.
NoSuchFactObjectException - If no object is known to be associated with the specified
handle.WorkingMemory.containsObject(org.drools.FactHandle)public java.util.List getObjects()
WorkingMemory
getObjects in interface WorkingMemorypublic java.util.List getObjects(java.lang.Class objectClass)
WorkingMemory
getObjects in interface WorkingMemoryobjectClass - The class of object to return.
public RuleBase getRuleBase()
WorkingMemoryRuleBase of this working memory.
getRuleBase in interface WorkingMemoryRuleBase.
public void modifyObject(FactHandle handle,
java.lang.Object object)
throws FactException
WorkingMemory
modifyObject in interface WorkingMemoryhandle - The fact-handle associated with the fact to modify.object - The new value of the fact.
FactException - If an error occurs.public void removeEventListener(WorkingMemoryEventListener listener)
WorkingMemory
removeEventListener in interface WorkingMemorylistener - The listener to remove.
public void retractObject(FactHandle handle)
throws FactException
WorkingMemory
retractObject in interface WorkingMemoryhandle - The fact-handle associated with the fact to retract.
FactException - If an error occurs.
public void setApplicationData(java.lang.String name,
java.lang.Object value)
WorkingMemory
setApplicationData in interface WorkingMemoryname - the name under which to populate the datavalue - the application datapublic void setAsyncExceptionHandler(AsyncExceptionHandler handler)
WorkingMemory
setAsyncExceptionHandler in interface WorkingMemory
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||