|
|||||||||
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(AgendaEventListener listener)
Add an event listener. |
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 |
void |
clearAgendaGroup(java.lang.String group)
Clear the Agenda Group |
void |
dispose()
Forces the workingMemory to be derefenced from |
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 |
Agenda |
getAgenda()
|
java.util.List |
getAgendaEventListeners()
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. |
AgendaGroup |
getFocus()
|
java.lang.Object |
getGlobal(java.lang.String name)
Retrieve a specific piece of global data by name |
java.util.Map |
getGlobals()
Retrieve all of the set application data in this memory |
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. |
QueryResults |
getQueryResults(java.lang.String query)
Retrieve the QueryResults of the specified query. |
RuleBase |
getRuleBase()
Retrieve the RuleBase of this working memory. |
java.util.List |
getWorkingMemoryEventListeners()
Returns all event listeners. |
void |
modifyObject(FactHandle handle,
java.lang.Object object)
Modify a fact. |
void |
removeEventListener(AgendaEventListener listener)
Remove an event listener. |
void |
removeEventListener(WorkingMemoryEventListener listener)
Remove an event listener. |
void |
retractObject(FactHandle handle)
Retract a fact. |
void |
setAsyncExceptionHandler(AsyncExceptionHandler handler)
Sets the AsyncExceptionHandler to handle exceptions thrown by the Agenda Scheduler used for duration rules. |
void |
setFocus(AgendaGroup focus)
|
void |
setFocus(java.lang.String focus)
|
void |
setGlobal(java.lang.String name,
java.lang.Object value)
Set a specific piece of global in this working memory. |
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 WorkingMemory
listener
- The listener to add.public FactHandle assertObject(java.lang.Object object, boolean dynamic) throws FactException
WorkingMemory
PropertyChangeListeners
on the Object to automatically trigger modifyObject
calls
if dynamic
is true
.
assertObject
in interface WorkingMemory
object
- 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 WorkingMemory
object
- The fact object.
FactException
- If an error occurs.public void clearAgenda()
WorkingMemory
clearAgenda
in interface WorkingMemory
public void clearAgendaGroup(java.lang.String group)
WorkingMemory
clearAgendaGroup
in interface WorkingMemory
public void fireAllRules() throws FactException
WorkingMemory
fireAllRules
in interface WorkingMemory
FactException
- If an error occurs.public void fireAllRules(AgendaFilter agendaFilter) throws FactException
WorkingMemory
fireAllRules
in interface WorkingMemory
FactException
- If an error occurs.public FactHandle getFactHandle(java.lang.Object object) throws NoSuchFactHandleException
WorkingMemory
FactHandle
associated with an Object.
getFactHandle
in interface WorkingMemory
object
- The object.
NoSuchFactHandleException
- If no handle is known to be associated with the specified
object.#containsObject
public java.util.List getFactHandles()
WorkingMemory
getFactHandles
in interface WorkingMemory
public java.lang.Object getObject(FactHandle handle) throws NoSuchFactObjectException
WorkingMemory
FactHandle
.
getObject
in interface WorkingMemory
handle
- The fact handle.
NoSuchFactObjectException
- If no object is known to be associated with the specified
handle.#containsObject
public java.util.List getObjects()
WorkingMemory
getObjects
in interface WorkingMemory
public java.util.List getObjects(java.lang.Class objectClass)
WorkingMemory
getObjects
in interface WorkingMemory
objectClass
- The class of object to return.
public RuleBase getRuleBase()
WorkingMemory
RuleBase
of this working memory.
getRuleBase
in interface WorkingMemory
RuleBase
.public void modifyObject(FactHandle handle, java.lang.Object object) throws FactException
WorkingMemory
modifyObject
in interface WorkingMemory
handle
- 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 WorkingMemory
listener
- The listener to remove.public void retractObject(FactHandle handle) throws FactException
WorkingMemory
retractObject
in interface WorkingMemory
handle
- The fact-handle associated with the fact to retract.
FactException
- If an error occurs.public void setAsyncExceptionHandler(AsyncExceptionHandler handler)
WorkingMemory
setAsyncExceptionHandler
in interface WorkingMemory
public void addEventListener(AgendaEventListener listener)
WorkingMemory
addEventListener
in interface WorkingMemory
listener
- The listener to add.public void dispose()
WorkingMemory
dispose
in interface WorkingMemory
public Agenda getAgenda()
getAgenda
in interface WorkingMemory
public java.util.List getAgendaEventListeners()
WorkingMemory
getAgendaEventListeners
in interface WorkingMemory
public AgendaGroup getFocus()
getFocus
in interface WorkingMemory
public java.lang.Object getGlobal(java.lang.String name)
WorkingMemory
getGlobal
in interface WorkingMemory
public java.util.Map getGlobals()
WorkingMemory
getGlobals
in interface WorkingMemory
public QueryResults getQueryResults(java.lang.String query)
WorkingMemory
getQueryResults
in interface WorkingMemory
query
- The name of the query.
public java.util.List getWorkingMemoryEventListeners()
WorkingMemory
getWorkingMemoryEventListeners
in interface WorkingMemory
public void removeEventListener(AgendaEventListener listener)
WorkingMemory
removeEventListener
in interface WorkingMemory
listener
- The listener to remove.public void setFocus(java.lang.String focus)
setFocus
in interface WorkingMemory
public void setFocus(AgendaGroup focus)
setFocus
in interface WorkingMemory
public void setGlobal(java.lang.String name, java.lang.Object value)
WorkingMemory
setGlobal
in interface WorkingMemory
name
- the name under which to populate the datavalue
- the application data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |