public class BufferedAuditEventWriter extends Thread implements AuditEventWriter, AuditEventListener
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
BufferedAuditEventWriter(AuditEventWriter wr)
This creates a new buffered event-writer that uses the given
event-writer implementation to write audit-events to disk.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(AuditEvent evt)
Add a new event to the list of events that need to be written to disk.
|
void |
addAll(Collection<AuditEvent> evts)
This method can be used to add a collection of events to the queue.
|
void |
close()
This method sets the finish-signal for this writer instance.
|
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.
|
boolean |
hasEventsPending()
This method can be used to check if any events are pending to be
written to disk by the underlying writer.
|
void |
run()
This method loops until the finished-method has been called.
|
void |
writeEvent(AuditEvent evt)
This method simply enqueue the event
evt to the list
of events waiting to be written to disk. |
activeCount, checkAccess, clone, 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, yieldpublic BufferedAuditEventWriter(AuditEventWriter wr)
wr - An instance that implements the AuditEventWriter interface.public void run()
run in interface Runnablerun in class ThreadThread.run()public void add(AuditEvent evt)
evt - The event to be written.public void addAll(Collection<AuditEvent> evts)
add(AuditEvent evt)-method this might block if the maximum size of
the internal queue is reached.evts - A collection of events that are to be written.public void close()
public boolean hasEventsPending()
true, iff the event-queue is not empty.public void writeEvent(AuditEvent evt) throws IOException
evt to the list
of events waiting to be written to disk.writeEvent in interface AuditEventWriterIOExceptionpublic void eventArrived(AuditEvent evt)
AuditEventListener
After the dispatcher calls this method each listener gets a call to
#notify(), thus a listener might wait for packets to arrive.
eventArrived in interface EventListener<AuditEvent>eventArrived in interface AuditEventListenerevt - The event which arrived.public void eventsArrived(Collection<AuditEvent> events)
AuditEventListenerAuditEventListener.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.eventsArrived in interface AuditEventListenerevents - The block of events arrived.Copyright © 2015 jwall.org. All Rights Reserved.