org.apache.log4j.helpers
public class BoundedFIFO extends Object
BoundedFIFO serves as the bounded first-in-first-out
buffer heavily used by the {@link org.apache.log4j.AsyncAppender}.Since: version 0.9.1
| 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, that is, whether
the number of elements in the buffer equals the buffer size. |
| int | length()
Get the number of elements in the buffer. |
| void | put(LoggingEvent o)
Place a {@link LoggingEvent} in the buffer. |
| void | resize(int newSize)
Resize the buffer to a new size. |
| boolean | wasEmpty()
Returns true if there is just one element in the
buffer. |
| boolean | wasFull()
Returns true if the number of elements in the
buffer plus 1 equals the maximum buffer size, returns
false otherwise. |
null if
there are no elements in the buffer.true if the buffer is full, that is, whether
the number of elements in the buffer equals the buffer size.maxSize
(inclusive).Since: 1.1
true if there is just one element in the
buffer. In other words, if there were no elements before the last
{@link #put} operation completed.true if the number of elements in the
buffer plus 1 equals the maximum buffer size, returns
false otherwise.