Save This Page
Home » slf4j-1.5.5 » org.apache » log4j » helpers » [javadoc | source]
org.apache.log4j.helpers
public class: BoundedFIFO [javadoc | source]
java.lang.Object
   org.apache.log4j.helpers.BoundedFIFO
BoundedFIFO serves as the bounded first-in-first-out buffer heavily used by the org.apache.log4j.AsyncAppender .
Field Summary
 LoggingEvent[] buf     
 int numElements     
 int first     
 int next     
 int maxSize     
Constructor:
 public BoundedFIFO(int maxSize) 
Method from org.apache.log4j.helpers.BoundedFIFO Summary:
get,   getMaxSize,   isFull,   length,   min,   put,   resize,   wasEmpty,   wasFull
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.log4j.helpers.BoundedFIFO Detail:
 public LoggingEvent get() 
    Get the first element in the buffer. Returns null if there are no elements in the buffer.
 public int getMaxSize() 
    Get the maximum size of the buffer.
 public boolean isFull() 
    Return true if the buffer is full, that is, whether the number of elements in the buffer equals the buffer size.
 public int length() 
    Get the number of elements in the buffer. This number is guaranteed to be in the range 0 to maxSize (inclusive).
 int min(int a,
    int b) 
 public  void put(LoggingEvent o) 
    Place a 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 synchronized  void resize(int newSize) 
    Resize the buffer to a new size. If the new size is smaller than the old size events might be lost.
 public boolean wasEmpty() 
    Returns true if there is just one element in the buffer. In other words, if there were no elements before the last #put operation completed.
 public boolean wasFull() 
    Returns true if the number of elements in the buffer plus 1 equals the maximum buffer size, returns false otherwise.