|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jwall.web.audit.AuditEventQueue
public class AuditEventQueue
A simple queue which holds some audit-events. The events are lined up in first-come-first-serve order. Accessing events may result in blocking if the queue is empty. See the methods comment for details.
| Constructor Summary | |
|---|---|
AuditEventQueue()
|
|
AuditEventQueue(java.util.Collection<AuditEvent> evts)
|
|
| Method Summary | |
|---|---|
long |
bytesAvailable()
|
long |
bytesRead()
|
void |
close()
|
void |
eventArrived(AuditEvent evt)
This method will add the event evt to the queue. |
boolean |
hasNext()
This method returns true, iff the queue is
non-empty. |
AuditEvent |
nextEvent()
This method will return the head of the queue, i.e. the events that has been in the queue for the longest term. |
AuditEvent |
readNext()
This method will return the next event (head) of the queue. |
void |
setFilter(AuditEventFilter filter)
This method sets a filter for the queue instance. |
int |
size()
This returns the number of events currently in the queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuditEventQueue()
public AuditEventQueue(java.util.Collection<AuditEvent> evts)
| Method Detail |
|---|
public boolean hasNext()
true, iff the queue is
non-empty. A return-value of true does not
guarantee that the next call to nextEvent
will not block, as a different thread might have emptied
the list in the meantime.
hasNext in interface AuditEventSourcetrue, iff queue is not empty.public AuditEvent nextEvent()
nextEvent in interface AuditEventSourcepublic void setFilter(AuditEventFilter filter)
setFilter in interface AuditEventSourcefilter - The filter used to match arriving events.public void eventArrived(AuditEvent evt)
evt to the queue. If
a filter has been set beforehand, the event will only be added
if it matches the filter.
eventArrived in interface AuditEventListenerAuditEventListener.eventArrived(org.jwall.web.audit.AuditEvent)
public AuditEvent readNext()
throws java.io.IOException,
ParseException
nextEvent() and will thus
block when called on an empty queue.
readNext in interface AuditEventReaderjava.io.IOException
ParseExceptionpublic int size()
public void close()
close in interface AuditEventReaderpublic long bytesAvailable()
bytesAvailable in interface AuditEventReaderpublic long bytesRead()
bytesRead in interface AuditEventReader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||