| java.lang.Object com.jamonapi.utils.BufferList
BufferList | public class BufferList implements DetailData(Code) | | This object can contain a configurable number of items in a buffer. The items kept are rows in a 2 dim
array and so the data can be viewed in a table. It is used in jamon to store recent exceptions, and
sql queries from the various proxy classes. However it may be used elsewhere. It is thread safe.
By default the buffer holds 50 elements, but this can be overridden in the constructor. It uses a bufferHolder to determine whether a value should be added and another one removed when the buffer is full. For example
the value could only be added if the new value is greater than the smallest member of the BufferList. Simply implement the BufferHolder
interface to implement your desired rules.
author: steve souza |
BufferList | public BufferList(String[] header)(Code) | | Constructor that takes the header of the structure of the rows that are stored.
For example header could be {"Time", "Exception info",};
Uses a FIFOBuffer.
Parameters: header - |
BufferList | public BufferList(String[] header, BufferHolder bufferHolder)(Code) | | Pass in the header and bufferHolder to be used
|
BufferList | public BufferList(String[] header, int bufferSize)(Code) | | Use a FIFOBuffer and specify its header and size
|
BufferList | public BufferList(String[] header, int bufferSize, BufferHolder bufferHolder)(Code) | | Specify the header, bufferSize and BufferHolder to be used in the BufferList
|
addRow | public synchronized void addRow(Object[] row)(Code) | | Add a row to be held in the buffer. If the buffer is full the oldest one will be removed.
|
disable | public synchronized void disable()(Code) | | Disable monitoring
|
enable | public synchronized void enable()(Code) | | Enable monitoring
|
getBufferSize | public synchronized int getBufferSize()(Code) | | Get the number of Exceptions that can be stored in the buffer before the oldest entries must
be removed.
|
getCollection | public List getCollection()(Code) | | Return the underlying Collection that holds the BufferList
|
getData | public Object[][] getData()(Code) | | Get the buffer as an array, so it can be displayed. Use getDetailData() method instead.
|
getHeader | public String[] getHeader()(Code) | | Get the header that can be used to display the buffer. Use getDetailData() method instead.
|
getRowCount | public int getRowCount()(Code) | | Return the rows in the BufferList
|
hasData | public boolean hasData()(Code) | | Return true if the bufferList has data
|
isEmpty | public boolean isEmpty()(Code) | | Return true if the bufferList is empty
|
isEnabled | public synchronized boolean isEnabled()(Code) | | Returns true if MonProxy is enabled.
|
reset | public synchronized void reset()(Code) | | Reset BufferList. It will empty the buffer and leave its size at the current value
|
resetBuffer | public synchronized void resetBuffer()(Code) | | Remove all Exceptions from the buffer. Not sure why this was needed vs reset()
|
setBufferSize | public synchronized void setBufferSize(int newBufferSize)(Code) | | Set the number of Exceptions that can be stored in the buffer before the oldest entries must
be removed. A value of 0 will disable the collection of Exceptions in the buffer. Note if
MonProxy is disabled exceptions will also not be put in the buffer.
|
|
|