|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.reteoo.WorkingMemoryImpl
Implementation of WorkingMemory
.
Constructor Summary | |
WorkingMemoryImpl(RuleBaseImpl ruleBase)
Construct. |
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 |
dumpMemory()
|
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 |
protected Agenda |
getAgenda()
Retrieve the rule-firing Agenda for this
WorkingMemory . |
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. |
WorkingMemoryEventSupport |
getEventSupport()
|
FactHandle |
getFactHandle(Object object)
Retrieve the FactHandle associated with an Object. |
List |
getFactHandles()
Retrieve all known Fact Handles. |
JoinMemory |
getJoinMemory(JoinNode node)
Retrieve the JoinMemory for a particular
JoinNode . |
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. |
(package private) FactHandle |
newFactHandle()
Create a new FactHandle . |
void |
propertyChange(PropertyChangeEvent event)
|
(package private) Object |
putObject(FactHandle handle,
Object object)
Associate an object with its handle. |
void |
removeEventListener(WorkingMemoryEventListener listener)
Remove an event listener. |
(package private) Object |
removeObject(FactHandle handle)
|
void |
retractObject(FactHandle handle)
Retract a fact. |
void |
setApplicationData(String name,
Object value)
Set a specific piece of application data 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 WorkingMemoryImpl(RuleBaseImpl ruleBase)
ruleBase
- The backing rule-base.Method Detail |
public void addEventListener(WorkingMemoryEventListener listener)
WorkingMemory
addEventListener
in interface WorkingMemory
listener
- The listener to add.public void removeEventListener(WorkingMemoryEventListener listener)
WorkingMemory
removeEventListener
in interface WorkingMemory
listener
- The listener to remove.public List getEventListeners()
WorkingMemory
getEventListeners
in interface WorkingMemory
FactHandle newFactHandle()
FactHandle
.
public Map getApplicationDataMap()
WorkingMemory
getApplicationDataMap
in interface WorkingMemory
WorkingMemory
public void setApplicationData(String name, Object value)
WorkingMemory
setApplicationData
in interface WorkingMemory
name
- the name under which to populate the datavalue
- the application dataWorkingMemory
public Object getApplicationData(String name)
WorkingMemory
getApplicationData
in interface WorkingMemory
WorkingMemory
protected Agenda getAgenda()
Agenda
for this
WorkingMemory
.
Agenda
.public void clearAgenda()
clearAgenda
in interface WorkingMemory
public RuleBase getRuleBase()
WorkingMemory
RuleBase
of this working memory.
getRuleBase
in interface WorkingMemory
RuleBase
.WorkingMemory
public void fireAllRules(AgendaFilter agendaFilter) throws FactException
WorkingMemory
fireAllRules
in interface WorkingMemory
FactException
- If an error occurs.public void fireAllRules() throws FactException
WorkingMemory
fireAllRules
in interface WorkingMemory
FactException
- If an error occurs.WorkingMemory
public 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.WorkingMemory
public FactHandle getFactHandle(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.WorkingMemory
public List getFactHandles()
WorkingMemory
getFactHandles
in interface WorkingMemory
public List getObjects()
WorkingMemory
getObjects
in interface WorkingMemory
WorkingMemory
public List getObjects(Class objectClass)
WorkingMemory
getObjects
in interface WorkingMemory
objectClass
- The class of object to return.
public boolean containsObject(FactHandle handle)
WorkingMemory
FactHandle
.
containsObject
in interface WorkingMemory
handle
- The fact handle.
true
if an object is known to be associated with
the specified handle, otherwise false
.WorkingMemory
public FactHandle assertObject(Object object) throws FactException
WorkingMemory
assertObject
in interface WorkingMemory
object
- The fact object.
FactException
- If an error occurs.WorkingMemory
public FactHandle assertObject(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.Object putObject(FactHandle handle, Object object)
handle
- The handle.object
- The object.Object removeObject(FactHandle handle)
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.WorkingMemory
public void modifyObject(FactHandle handle, 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.WorkingMemory
public JoinMemory getJoinMemory(JoinNode node)
JoinMemory
for a particular
JoinNode
.
node
- The JoinNode
key.
public WorkingMemoryEventSupport getEventSupport()
public void dumpMemory()
public void propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |