|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.log4j.helpers.BoundedFIFO
BoundedFIFO
serves as the bounded first-in-first-out
buffer heavily used by the AsyncAppender
.
Constructor Summary | |
BoundedFIFO(int maxSize)
Instantiate a new BoundedFIFO with a maximum size passed as argument. |
Method Summary | |
LoggingEvent |
get()
Get the first element in the buffer. |
int |
getMaxSize()
Get the maximum size of the buffer. |
boolean |
isFull()
Return true if the buffer is full, i.e. |
int |
length()
Get the number of elements in the buffer. |
void |
put(LoggingEvent o)
Place a LoggingEvent in the buffer. |
boolean |
wasEmpty()
Returns true if there is just one element in the
buffer. |
boolean |
wasFull()
Returns true if there the number of elements in the
buffer plus 1 equals the maximum buffer size, returns
false otherwise. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BoundedFIFO(int maxSize)
Method Detail |
public LoggingEvent get()
null
if
there are no elements in the buffer.public void put(LoggingEvent o)
LoggingEvent
in the buffer. If the buffer is full
then the event is silently dropped. It is the caller's
responsability to make sure that the buffer has free space.public int getMaxSize()
public boolean isFull()
true
if the buffer is full, i.e. of the
number of elements in the buffer equals the buffer size.public int length()
maxSize
(inclusive).public boolean wasEmpty()
true
if there is just one element in the
buffer. In other words, if there were no elements before the last
put(org.log4j.spi.LoggingEvent)
operation completed.public boolean wasFull()
true
if there the number of elements in the
buffer plus 1 equals the maximum buffer size, returns
false
otherwise.
|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |