org.jwall.audit.rules
Class EventRuleEngine<E extends Event>

java.lang.Object
  extended by org.jwall.audit.rules.EventRuleEngine<E>
Type Parameters:
E -
All Implemented Interfaces:
EventProcessor<E>
Direct Known Subclasses:
AuditEventRuleEngine

public abstract class EventRuleEngine<E extends Event>
extends Object
implements EventProcessor<E>

A simple engine that will sequentially process rules for an event. If any of that rules does flag the event as DELETED, then rule processing will be stopped.

Author:
Christian Bockermann <chris@jwall.org>

Field Summary
 
Fields inherited from interface org.jwall.audit.EventProcessor
DELETE_FLAG
 
Constructor Summary
EventRuleEngine()
           
 
Method Summary
 List<EventRule<E>> getRules()
           
 E processEvent(E event, Map<String,Object> context)
          This method is called upon event reception.
 void setRules(List<EventRule<E>> rules)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventRuleEngine

public EventRuleEngine()
Method Detail

getRules

public List<EventRule<E>> getRules()
Returns:
the rules

setRules

public void setRules(List<EventRule<E>> rules)
Parameters:
rules - the rules to set

processEvent

public final E processEvent(E event,
                            Map<String,Object> context)
                                   throws Exception
Description copied from interface: EventProcessor
This method is called upon event reception. The given map provides a context to communicate data between several event-processors. The implementor of this interface needs to take care that calls to this class my come from different threads, i.e. no state should be stored in the class to diminish the risk of concurrency problems.

Specified by:
processEvent in interface EventProcessor<E extends Event>
Returns:
Throws:
Exception
See Also:
EventProcessor.processEvent(org.jwall.audit.Event, java.util.Map)


Copyright © 2012 jwall.org. All Rights Reserved.