|
||||||||||
| 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()
This creates new empty queue for holding audit events. |
|
AuditEventQueue(Collection<AuditEvent> evts)
This creates a new queue which is initially filled with the given set of events. |
|
| Method Summary | |
|---|---|
boolean |
atEOF()
|
long |
bytesAvailable()
|
long |
bytesRead()
|
void |
close()
|
void |
eventArrived(AuditEvent evt)
This method will add the event evt to the queue. |
void |
eventsArrived(Collection<AuditEvent> events)
This method is called for notifying the listener of arrival of several events in a block. |
boolean |
hasNext()
This method returns true, iff the queue is
non-empty. |
Iterator<AuditEvent> |
iterator()
|
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 tries to read the next event that is available. |
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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuditEventQueue()
public AuditEventQueue(Collection<AuditEvent> evts)
evts - The initial set of events.| 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 EventListener<AuditEvent>eventArrived in interface AuditEventListenerevt - The event which arrived.AuditEventListener.eventArrived(org.jwall.web.audit.AuditEvent)public int size()
public long bytesAvailable()
bytesAvailable in interface AuditEventReaderAuditEventReader.bytesAvailable()public long bytesRead()
bytesRead in interface AuditEventReaderAuditEventReader.bytesRead()
public void close()
throws IOException
close in interface AuditEventReaderIOExceptionAuditEventReader.close()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.
public AuditEvent readNext()
throws IOException,
ParseException
AuditEventReader
readNext in interface AuditEventReaderNULL if no event is available.
IOException
ParseExceptionAuditEventReader.readNext()public boolean atEOF()
atEOF in interface AuditEventReaderpublic Iterator<AuditEvent> iterator()
iterator in interface Iterable<AuditEvent>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||