|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
org.jwall.web.audit.io.BufferedAuditEventWriter
public class BufferedAuditEventWriter
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
BufferedAuditEventWriter(AuditEventWriter wr)
This creates a new buffered event-writer that uses the given event-writer implementation to write audit-events to disk. |
|
| Method Summary | |
|---|---|
void |
add(AuditEvent evt)
Add a new event to the list of events that need to be written to disk. |
void |
addAll(java.util.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. |
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. |
| 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 |
| Constructor Detail |
|---|
public BufferedAuditEventWriter(AuditEventWriter wr)
wr - An instance that implements the AuditEventWriter interface.| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.ThreadThread.run()public void add(AuditEvent evt)
evt - The event to be written.public void addAll(java.util.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 java.io.IOException
evt to the list
of events waiting to be written to disk.
writeEvent in interface AuditEventWriterjava.io.IOExceptionpublic void eventArrived(AuditEvent evt)
AuditEventListenernotiy(), thus a listener might wait for packets
to arrive.
eventArrived in interface AuditEventListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||