org.drools.audit
Class WorkingMemoryLogger

java.lang.Object
  extended by org.drools.audit.WorkingMemoryLogger
All Implemented Interfaces:
Externalizable, Serializable, EventListener, AgendaEventListener, org.drools.event.process.ProcessEventListener, RuleBaseEventListener, WorkingMemoryEventListener
Direct Known Subclasses:
WorkingMemoryConsoleLogger, WorkingMemoryFileLogger, WorkingMemoryInMemoryLogger

public abstract class WorkingMemoryLogger
extends Object
implements WorkingMemoryEventListener, AgendaEventListener, org.drools.event.process.ProcessEventListener, RuleBaseEventListener

A logger of events generated by a working memory. It listens to the events generated by the working memory and creates associated log event (containing a snapshot of the state of the working event at that time). Filters can be used to filter out unwanted events. Subclasses of this class should implement the logEventCreated(LogEvent) method and store this information, like for example log to file or database.

See Also:
Serialized Form

Constructor Summary
WorkingMemoryLogger()
           
WorkingMemoryLogger(org.drools.event.KnowledgeRuntimeEventManager session)
           
WorkingMemoryLogger(WorkingMemory workingMemory)
          Creates a new working memory logger for the given working memory.
 
Method Summary
 void activationCancelled(ActivationCancelledEvent event, WorkingMemory workingMemory)
           
 void activationCreated(ActivationCreatedEvent event, WorkingMemory workingMemory)
           
 void addFilter(ILogEventFilter filter)
          Adds the given filter to the list of filters for this event log.
 void afterActivationFired(AfterActivationFiredEvent event, WorkingMemory workingMemory)
           
 void afterFunctionRemoved(AfterFunctionRemovedEvent event)
          Method called after a function is removed from the rule base
 void afterNodeLeft(org.drools.event.process.ProcessNodeLeftEvent event)
           
 void afterNodeTriggered(org.drools.event.process.ProcessNodeTriggeredEvent event)
           
 void afterPackageAdded(AfterPackageAddedEvent event)
          Method called after a new package is added to the rule base
 void afterPackageRemoved(AfterPackageRemovedEvent event)
          Method called after a package is removed from the rule base
 void afterProcessAdded(AfterProcessAddedEvent event)
          Method called after a new process is added to the rule base
 void afterProcessCompleted(org.drools.event.process.ProcessCompletedEvent event)
           
 void afterProcessRemoved(AfterProcessRemovedEvent event)
          Method called after a process is removed from the rule base
 void afterProcessStarted(org.drools.event.process.ProcessStartedEvent event)
           
 void afterRuleAdded(AfterRuleAddedEvent event)
          Method called after a new rule is added to the rule base
 void afterRuleBaseLocked(AfterRuleBaseLockedEvent event)
          Method called after a rule base is locked
 void afterRuleBaseUnlocked(AfterRuleBaseUnlockedEvent event)
          Method called after a rule base is unlocked
 void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event, WorkingMemory workingMemory)
           
 void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event, WorkingMemory workingMemory)
           
 void afterRuleRemoved(AfterRuleRemovedEvent event)
          Method called after a rule is removed from the rule base
 void afterVariableChanged(org.drools.event.process.ProcessVariableChangedEvent event)
           
 void agendaGroupPopped(AgendaGroupPoppedEvent event, WorkingMemory workingMemory)
           
 void agendaGroupPushed(AgendaGroupPushedEvent event, WorkingMemory workingMemory)
           
 void beforeActivationFired(BeforeActivationFiredEvent event, WorkingMemory workingMemory)
           
 void beforeFunctionRemoved(BeforeFunctionRemovedEvent event)
          Method called before a function is removed from the rule base
 void beforeNodeLeft(org.drools.event.process.ProcessNodeLeftEvent event)
           
 void beforeNodeTriggered(org.drools.event.process.ProcessNodeTriggeredEvent event)
           
 void beforePackageAdded(BeforePackageAddedEvent event)
          Method called before a new package is added to the rule base
 void beforePackageRemoved(BeforePackageRemovedEvent event)
          Method called before a package is removed from the rule base
 void beforeProcessAdded(BeforeProcessAddedEvent event)
          Method called before a new process is added to the rule base
 void beforeProcessCompleted(org.drools.event.process.ProcessCompletedEvent event)
           
 void beforeProcessRemoved(BeforeProcessRemovedEvent event)
          Method called before a process is removed from the rule base
 void beforeProcessStarted(org.drools.event.process.ProcessStartedEvent event)
           
 void beforeRuleAdded(BeforeRuleAddedEvent event)
          Method called before a new rule is added to the rule base
 void beforeRuleBaseLocked(BeforeRuleBaseLockedEvent event)
          Method called before a rule base is locked
 void beforeRuleBaseUnlocked(BeforeRuleBaseUnlockedEvent event)
          Method called before a rule base is unlocked
 void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event, WorkingMemory workingMemory)
           
 void beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event, WorkingMemory workingMemory)
           
 void beforeRuleRemoved(BeforeRuleRemovedEvent event)
          Method called before a rule is removed from the rule base
 void beforeVariableChanged(org.drools.event.process.ProcessVariableChangedEvent event)
           
 void clearFilters()
          Clears all filters of this event log.
abstract  void logEventCreated(LogEvent logEvent)
          This method is invoked every time a new log event is created.
 void objectInserted(ObjectInsertedEvent event)
           
 void objectRetracted(ObjectRetractedEvent event)
           
 void objectUpdated(ObjectUpdatedEvent event)
           
 void readExternal(ObjectInput in)
           
 void removeFilter(ILogEventFilter filter)
          Removes the given filter from the list of filters for this event log.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkingMemoryLogger

public WorkingMemoryLogger()

WorkingMemoryLogger

public WorkingMemoryLogger(WorkingMemory workingMemory)
Creates a new working memory logger for the given working memory.

Parameters:
workingMemory -

WorkingMemoryLogger

public WorkingMemoryLogger(org.drools.event.KnowledgeRuntimeEventManager session)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

logEventCreated

public abstract void logEventCreated(LogEvent logEvent)
This method is invoked every time a new log event is created. Subclasses should implement this method and store the event, like for example log to a file or database.

Parameters:
logEvent -

addFilter

public void addFilter(ILogEventFilter filter)
Adds the given filter to the list of filters for this event log. A log event must be accepted by all the filters to be entered in the event log.

Parameters:
filter - The filter that should be added.

removeFilter

public void removeFilter(ILogEventFilter filter)
Removes the given filter from the list of filters for this event log. If the given filter was not a filter of this event log, nothing happens.

Parameters:
filter - The filter that should be removed.

clearFilters

public void clearFilters()
Clears all filters of this event log.


objectInserted

public void objectInserted(ObjectInsertedEvent event)
Specified by:
objectInserted in interface WorkingMemoryEventListener
See Also:
WorkingMemoryEventListener

objectUpdated

public void objectUpdated(ObjectUpdatedEvent event)
Specified by:
objectUpdated in interface WorkingMemoryEventListener
See Also:
WorkingMemoryEventListener

objectRetracted

public void objectRetracted(ObjectRetractedEvent event)
Specified by:
objectRetracted in interface WorkingMemoryEventListener
See Also:
WorkingMemoryEventListener

activationCreated

public void activationCreated(ActivationCreatedEvent event,
                              WorkingMemory workingMemory)
Specified by:
activationCreated in interface AgendaEventListener
See Also:
AgendaEventListener

activationCancelled

public void activationCancelled(ActivationCancelledEvent event,
                                WorkingMemory workingMemory)
Specified by:
activationCancelled in interface AgendaEventListener
See Also:
AgendaEventListener

beforeActivationFired

public void beforeActivationFired(BeforeActivationFiredEvent event,
                                  WorkingMemory workingMemory)
Specified by:
beforeActivationFired in interface AgendaEventListener
See Also:
AgendaEventListener

afterActivationFired

public void afterActivationFired(AfterActivationFiredEvent event,
                                 WorkingMemory workingMemory)
Specified by:
afterActivationFired in interface AgendaEventListener
See Also:
AgendaEventListener

agendaGroupPopped

public void agendaGroupPopped(AgendaGroupPoppedEvent event,
                              WorkingMemory workingMemory)
Specified by:
agendaGroupPopped in interface AgendaEventListener

agendaGroupPushed

public void agendaGroupPushed(AgendaGroupPushedEvent event,
                              WorkingMemory workingMemory)
Specified by:
agendaGroupPushed in interface AgendaEventListener

beforeRuleFlowGroupActivated

public void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
                                         WorkingMemory workingMemory)
Specified by:
beforeRuleFlowGroupActivated in interface AgendaEventListener

afterRuleFlowGroupActivated

public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
                                        WorkingMemory workingMemory)
Specified by:
afterRuleFlowGroupActivated in interface AgendaEventListener

beforeRuleFlowGroupDeactivated

public void beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
                                           WorkingMemory workingMemory)
Specified by:
beforeRuleFlowGroupDeactivated in interface AgendaEventListener

afterRuleFlowGroupDeactivated

public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
                                          WorkingMemory workingMemory)
Specified by:
afterRuleFlowGroupDeactivated in interface AgendaEventListener

beforeProcessStarted

public void beforeProcessStarted(org.drools.event.process.ProcessStartedEvent event)
Specified by:
beforeProcessStarted in interface org.drools.event.process.ProcessEventListener

afterProcessStarted

public void afterProcessStarted(org.drools.event.process.ProcessStartedEvent event)
Specified by:
afterProcessStarted in interface org.drools.event.process.ProcessEventListener

beforeProcessCompleted

public void beforeProcessCompleted(org.drools.event.process.ProcessCompletedEvent event)
Specified by:
beforeProcessCompleted in interface org.drools.event.process.ProcessEventListener

afterProcessCompleted

public void afterProcessCompleted(org.drools.event.process.ProcessCompletedEvent event)
Specified by:
afterProcessCompleted in interface org.drools.event.process.ProcessEventListener

beforeNodeTriggered

public void beforeNodeTriggered(org.drools.event.process.ProcessNodeTriggeredEvent event)
Specified by:
beforeNodeTriggered in interface org.drools.event.process.ProcessEventListener

afterNodeTriggered

public void afterNodeTriggered(org.drools.event.process.ProcessNodeTriggeredEvent event)
Specified by:
afterNodeTriggered in interface org.drools.event.process.ProcessEventListener

beforeNodeLeft

public void beforeNodeLeft(org.drools.event.process.ProcessNodeLeftEvent event)
Specified by:
beforeNodeLeft in interface org.drools.event.process.ProcessEventListener

afterNodeLeft

public void afterNodeLeft(org.drools.event.process.ProcessNodeLeftEvent event)
Specified by:
afterNodeLeft in interface org.drools.event.process.ProcessEventListener

beforeVariableChanged

public void beforeVariableChanged(org.drools.event.process.ProcessVariableChangedEvent event)
Specified by:
beforeVariableChanged in interface org.drools.event.process.ProcessEventListener

afterVariableChanged

public void afterVariableChanged(org.drools.event.process.ProcessVariableChangedEvent event)
Specified by:
afterVariableChanged in interface org.drools.event.process.ProcessEventListener

afterPackageAdded

public void afterPackageAdded(AfterPackageAddedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a new package is added to the rule base

Specified by:
afterPackageAdded in interface RuleBaseEventListener

afterPackageRemoved

public void afterPackageRemoved(AfterPackageRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a package is removed from the rule base

Specified by:
afterPackageRemoved in interface RuleBaseEventListener

afterRuleAdded

public void afterRuleAdded(AfterRuleAddedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a new rule is added to the rule base

Specified by:
afterRuleAdded in interface RuleBaseEventListener

afterRuleRemoved

public void afterRuleRemoved(AfterRuleRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a rule is removed from the rule base

Specified by:
afterRuleRemoved in interface RuleBaseEventListener

beforePackageAdded

public void beforePackageAdded(BeforePackageAddedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a new package is added to the rule base

Specified by:
beforePackageAdded in interface RuleBaseEventListener

beforePackageRemoved

public void beforePackageRemoved(BeforePackageRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a package is removed from the rule base

Specified by:
beforePackageRemoved in interface RuleBaseEventListener

beforeRuleAdded

public void beforeRuleAdded(BeforeRuleAddedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a new rule is added to the rule base

Specified by:
beforeRuleAdded in interface RuleBaseEventListener

beforeRuleRemoved

public void beforeRuleRemoved(BeforeRuleRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a rule is removed from the rule base

Specified by:
beforeRuleRemoved in interface RuleBaseEventListener

afterFunctionRemoved

public void afterFunctionRemoved(AfterFunctionRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a function is removed from the rule base

Specified by:
afterFunctionRemoved in interface RuleBaseEventListener

afterRuleBaseLocked

public void afterRuleBaseLocked(AfterRuleBaseLockedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a rule base is locked

Specified by:
afterRuleBaseLocked in interface RuleBaseEventListener

afterRuleBaseUnlocked

public void afterRuleBaseUnlocked(AfterRuleBaseUnlockedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a rule base is unlocked

Specified by:
afterRuleBaseUnlocked in interface RuleBaseEventListener

beforeFunctionRemoved

public void beforeFunctionRemoved(BeforeFunctionRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a function is removed from the rule base

Specified by:
beforeFunctionRemoved in interface RuleBaseEventListener

beforeRuleBaseLocked

public void beforeRuleBaseLocked(BeforeRuleBaseLockedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a rule base is locked

Specified by:
beforeRuleBaseLocked in interface RuleBaseEventListener

beforeRuleBaseUnlocked

public void beforeRuleBaseUnlocked(BeforeRuleBaseUnlockedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a rule base is unlocked

Specified by:
beforeRuleBaseUnlocked in interface RuleBaseEventListener

beforeProcessAdded

public void beforeProcessAdded(BeforeProcessAddedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a new process is added to the rule base

Specified by:
beforeProcessAdded in interface RuleBaseEventListener

afterProcessAdded

public void afterProcessAdded(AfterProcessAddedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a new process is added to the rule base

Specified by:
afterProcessAdded in interface RuleBaseEventListener

beforeProcessRemoved

public void beforeProcessRemoved(BeforeProcessRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called before a process is removed from the rule base

Specified by:
beforeProcessRemoved in interface RuleBaseEventListener

afterProcessRemoved

public void afterProcessRemoved(AfterProcessRemovedEvent event)
Description copied from interface: RuleBaseEventListener
Method called after a process is removed from the rule base

Specified by:
afterProcessRemoved in interface RuleBaseEventListener


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.