org.jwall.audit.server
Class AuditEventStreamHandler

java.lang.Object
  extended by java.lang.Thread
      extended by org.jwall.audit.server.AuditEventStreamHandler
All Implemented Interfaces:
Runnable, EventListener<AuditEvent>, AuditEventListener

public class AuditEventStreamHandler
extends Thread
implements AuditEventListener


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AuditEventStreamHandler(SyslogReceiver parent, Socket socket, boolean gzip)
           
 
Method Summary
 void eventArrived(AuditEvent evt)
          This method is called when a new event arrives at the listener.
 void eventsArrived(Collection<AuditEvent> events)
          This method is called for notifying the listener of arrival of several events in a block.
 void run()
           
 void setEventStore(AuditEventListener store)
           
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuditEventStreamHandler

public AuditEventStreamHandler(SyslogReceiver parent,
                               Socket socket,
                               boolean gzip)
                        throws Exception
Throws:
Exception
Method Detail

setEventStore

public void setEventStore(AuditEventListener store)

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.run()

eventArrived

public void eventArrived(AuditEvent evt)
Description copied from interface: AuditEventListener
This method is called when a new event arrives at the listener. The Listener should be threaded and response-time to this method should be as small as possible.

After the dispatcher calls this method each listener gets a call to #notify(), thus a listener might wait for packets to arrive.

Specified by:
eventArrived in interface EventListener<AuditEvent>
Specified by:
eventArrived in interface AuditEventListener
Parameters:
evt - The event which arrived.

eventsArrived

public void eventsArrived(Collection<AuditEvent> events)
Description copied from interface: AuditEventListener
This method is called for notifying the listener of arrival of several events in a block. Usually, this method is implemented by calling AuditEventListener.eventArrived(AuditEvent) for each of the given events, but may be handled in a more efficient way by implementations capable of processing blocks of events.

Specified by:
eventsArrived in interface AuditEventListener
Parameters:
events - The block of events arrived.


Copyright © 2012 jwall.org. All Rights Reserved.