org.jwall.web.audit
Class AuditEventDispatcher

java.lang.Object
  extended by java.lang.Thread
      extended by org.jwall.web.audit.AuditEventDispatcher
All Implemented Interfaces:
java.lang.Runnable

public class AuditEventDispatcher
extends java.lang.Thread

This interface defines the method required by a class that somehow produces events and dispatches them to all of the registered listeners.

Author:
Christian Bockermann <chris@jwall.org>

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static boolean DEBUG
           
static int READER_WAITING_TIME
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AuditEventDispatcher()
           
AuditEventDispatcher(AuditEventReader src)
           
 
Method Summary
 void add(AuditEvent evt)
           
 void addAuditEventListener(AuditEventListener listener)
          Register another listener which is to be notified if another event has been created.
 void close()
           
 void enqueueEvent(AuditEvent evt)
           
 void removeAuditEventListener(AuditEventListener listener)
          Remove the given listener from the list of listeners.
 void run()
          This is a loop that fetches events from the AuditEventSource associated with this dispatcher and notifies the registered listeners.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

READER_WAITING_TIME

public static final int READER_WAITING_TIME
See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG
Constructor Detail

AuditEventDispatcher

public AuditEventDispatcher()

AuditEventDispatcher

public AuditEventDispatcher(AuditEventReader src)
Parameters:
src -
Method Detail

add

public void add(AuditEvent evt)

enqueueEvent

public void enqueueEvent(AuditEvent evt)

addAuditEventListener

public void addAuditEventListener(AuditEventListener listener)
Register another listener which is to be notified if another event has been created.

Parameters:
listener -

removeAuditEventListener

public void removeAuditEventListener(AuditEventListener listener)
Remove the given listener from the list of listeners. This method simply does nothing, if the given listener is not registered.

Parameters:
listener -

run

public void run()
This is a loop that fetches events from the AuditEventSource associated with this dispatcher and notifies the registered listeners.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException