org.jwall.web.audit
Class AuditEventProcessorPipeline

java.lang.Object
  extended by org.jwall.web.audit.AuditEventProcessorPipeline
All Implemented Interfaces:
EventProcessorPipeline<AuditEvent>

public class AuditEventProcessorPipeline
extends Object
implements EventProcessorPipeline<AuditEvent>

This singleton class encapsulates a global, static queue of event processor instances. The processors can be registered using a priority, affecting their execution order in the queue.

For each incoming event, this queue is processed before the event is stored within the event storage.

In addition to the processors, this queue also provides a place for registering event-listeners. These are notified after all processors have been applied to the event.

Author:
Christian Bockermann <chris@jwall.org>

Nested Class Summary
 class AuditEventProcessorPipeline.Priority
           
 
Field Summary
static Double DEFAULT_PRIORITY
           
 
Constructor Summary
AuditEventProcessorPipeline()
           
 
Method Summary
 List<EventListener<AuditEvent>> getListeners()
           
 Double getPriority(EventProcessor<AuditEvent> proc)
           
 List<EventProcessor<AuditEvent>> getProcessors()
           
 void logInfo()
           
 void process(AuditEvent event)
           
 AuditEvent processEvent(AuditEvent event)
          This method applies all registered processors to the specified event.
 void register(Double priority, EventProcessor<AuditEvent> proc)
          Register a new event processor in this pipeline.
 void registerListener(EventListener<AuditEvent> l)
           
 void unregister(EventProcessor<AuditEvent> proc)
          Unregister the given processor from this pipeline.
 void unregisterEventProcessor(EventProcessor<AuditEvent> p)
          This method is used to unregister an event-processor from the AuditStorage
 void unregisterListener(EventListener<AuditEvent> l)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PRIORITY

public static final Double DEFAULT_PRIORITY
Constructor Detail

AuditEventProcessorPipeline

public AuditEventProcessorPipeline()
Method Detail

processEvent

public AuditEvent processEvent(AuditEvent event)
                        throws EventProcessorException
This method applies all registered processors to the specified event.

Parameters:
event -
Returns:
Throws:
EventProcessorException

unregisterEventProcessor

public void unregisterEventProcessor(EventProcessor<AuditEvent> p)
This method is used to unregister an event-processor from the AuditStorage

Parameters:
p -

unregisterListener

public void unregisterListener(EventListener<AuditEvent> l)

registerListener

public void registerListener(EventListener<AuditEvent> l)

logInfo

public void logInfo()

process

public void process(AuditEvent event)
             throws EventProcessorException
Specified by:
process in interface EventProcessorPipeline<AuditEvent>
Throws:
EventProcessorException
See Also:
org.jwall.web.audit.console.event.EventProcessorPipeline#process(org.jwall.audit.Event)

getProcessors

public List<EventProcessor<AuditEvent>> getProcessors()

getListeners

public List<EventListener<AuditEvent>> getListeners()

unregister

public void unregister(EventProcessor<AuditEvent> proc)
Description copied from interface: EventProcessorPipeline
Unregister the given processor from this pipeline.

Specified by:
unregister in interface EventProcessorPipeline<AuditEvent>
Parameters:
proc - The processor to remove from the pipeline.
See Also:
org.jwall.web.audit.console.event.EventProcessorPipeline#unregister(org.jwall.audit.EventProcessor)

register

public void register(Double priority,
                     EventProcessor<AuditEvent> proc)
Description copied from interface: EventProcessorPipeline
Register a new event processor in this pipeline. The processor may specify a priority, signaling at which position it wants to be inserted. Processing is done from low numbers to high numbers. Priorities smaller than 1 and larger than 10 are reserved to internal processors. Registering a non-internal processor with invalid priority will register that processor with the nearest valid priority value.

Specified by:
register in interface EventProcessorPipeline<AuditEvent>
Parameters:
priority - The priority with which this processor is inserted into the pipeline.
proc - The new processor to be added to the pipeline.
See Also:
org.jwall.web.audit.console.event.EventProcessorPipeline#register(java.lang.Double, org.jwall.audit.EventProcessor)

getPriority

public Double getPriority(EventProcessor<AuditEvent> proc)
Specified by:
getPriority in interface EventProcessorPipeline<AuditEvent>


Copyright © 2012 jwall.org. All Rights Reserved.