|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.drools.audit.WorkingMemoryLogger org.drools.audit.WorkingMemoryFileLogger
public class WorkingMemoryFileLogger
A logger of events generated by a working memory. It stores its information in a file that can be specified. All the events logged are written to the file when the writeToDisk() method is invoked. The log will contain all the events logged serialized to XML using XStream. Every time a new logger is created, the old event log will be overwritten. TODO: make this class more scalable, for example - logging to several files if log becomes too large - automatically write updates to file at certain time intervals - ...
Constructor Summary | |
---|---|
WorkingMemoryFileLogger(WorkingMemory workingMemory)
Creates a new WorkingMemoryFileLogger for the given working memory. |
Method Summary | |
---|---|
void |
clear()
Clears all the events in the log. |
void |
finalize()
|
void |
logEventCreated(LogEvent logEvent)
This method is invoked every time a new log event is created. |
void |
setFileName(String fileName)
Sets the name of the file the events are logged in. |
void |
setMaxEventsInMemory(int maxEventsInMemory)
Sets the maximum number of log events that are allowed in memory. |
void |
writeToDisk()
All events in the log are written to file. |
Methods inherited from class org.drools.audit.WorkingMemoryLogger |
---|
activationCancelled, activationCreated, addFilter, afterActivationFired, agendaGroupPopped, agendaGroupPushed, beforeActivationFired, clearFilters, objectAsserted, objectModified, objectRetracted, removeFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkingMemoryFileLogger(WorkingMemory workingMemory)
workingMemory
- Method Detail |
---|
public void setFileName(String fileName)
fileName
- The name of the file the events should be logged in.public void writeToDisk()
public void clear()
public void setMaxEventsInMemory(int maxEventsInMemory)
maxEventsInMemory
- The maximum number of events in memory.public void logEventCreated(LogEvent logEvent)
WorkingMemoryLogger
logEventCreated
in class WorkingMemoryLogger
WorkingMemoryLogger
public void finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |