|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 - ...
Field Summary | |
---|---|
protected boolean |
terminate
|
Constructor Summary | |
---|---|
WorkingMemoryFileLogger()
|
|
WorkingMemoryFileLogger(org.drools.event.KnowledgeRuntimeEventManager session)
|
|
WorkingMemoryFileLogger(WorkingMemory workingMemory)
Creates a new WorkingMemoryFileLogger for the given working memory. |
Method Summary | |
---|---|
void |
logEventCreated(LogEvent logEvent)
This method is invoked every time a new log event is created. |
void |
readExternal(ObjectInput in)
|
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 |
setSplit(boolean split)
|
void |
stop()
|
void |
writeExternal(ObjectOutput out)
|
void |
writeToDisk()
All events in the log are written to file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean terminate
Constructor Detail |
---|
public WorkingMemoryFileLogger()
public WorkingMemoryFileLogger(WorkingMemory workingMemory)
workingMemoryEventManager
- public WorkingMemoryFileLogger(org.drools.event.KnowledgeRuntimeEventManager session)
Method Detail |
---|
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class WorkingMemoryLogger
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class WorkingMemoryLogger
IOException
public void setFileName(String fileName)
fileName
- The name of the file the events should be logged in.public void writeToDisk()
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 setSplit(boolean split)
public void stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |