|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.lib.jmbeans.log.LogBuffer
public class LogBuffer
THis MBean receives and treats LogRecords contained in notifications emitted by the Monolog JmxHandler. The treatement is aimed to provided structured data for JonasAdmin.
Field Summary |
---|
Fields inherited from interface org.ow2.jonas.lib.jmbeans.log.LogBufferMBean |
---|
INFO, SEVERE, WARNING |
Constructor Summary | |
---|---|
LogBuffer(String name)
The MBean constructor. |
Method Summary | |
---|---|
protected void |
addToLogRecordsQueue(LogRecord record)
Add a LogRecord to the queue |
protected void |
addToRecentLog(LogRecord record)
Add a LogRecord to the recent recors list |
StringBuffer |
fetchRecords()
Fetch records |
StringBuffer |
fetchRecords(Long from,
Long to)
|
StringBuffer |
fetchRecords(Long from,
Long to,
int level)
|
int |
getCapacity()
|
long |
getInfoCount()
|
long |
getLatestDate()
|
int |
getLevel()
Not used currently. |
long |
getOldestDate()
|
long |
getOtherCount()
|
String |
getRecent()
|
int |
getRecentCapacity()
|
long |
getRecordCount()
|
long |
getSevereCount()
|
long |
getWarningCount()
|
protected void |
incInfoCount()
Increment counter of received LogRecords having INFO level |
protected void |
incOtherCount()
Increment counter of received LogRecords having level different of INFO, WARNING, SEVERE |
protected void |
incRecordCount()
Increment counter of received LogRecors |
protected void |
incSevereCount()
Increment counter of received LogRecords having SEVERE level |
protected void |
incWarningCount()
Increment counter of received LogRecords having WARNING level |
void |
postDeregister()
Nothing to do after deregisteing |
void |
postRegister(Boolean arg0)
After registering, add LogNotificationListener as listener for notifications emitted by the LogManagement MBean |
void |
preDeregister()
Before deregistering, remove LogNotificationListener listener |
ObjectName |
preRegister(MBeanServer mbs,
ObjectName on)
Allows getting a refernce to the MBean server, getting the domain name, and if necessary, constructing an ObjectName |
void |
setCapacity(int records)
Max number of records to hold (max records of the feeder) |
protected void |
setLatestDate(long latestDate)
|
void |
setLevel(int level)
|
void |
setOldestDate(long oldestDate)
|
void |
setRecentCapacity(int recentCapacity)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogBuffer(String name)
name
- the name used to construct the ObjectNameMethod Detail |
---|
public StringBuffer fetchRecords()
LogBufferMBean
fetchRecords
in interface LogBufferMBean
public StringBuffer fetchRecords(Long from, Long to)
fetchRecords
in interface LogBufferMBean
from
- the LogRecord inferior time limitto
- the LogRecord upper time limit
public StringBuffer fetchRecords(Long from, Long to, int level)
fetchRecords
in interface LogBufferMBean
from
- the LogRecord inferior time limitto
- the LogRecord upper time limitlevel
- ...
public int getCapacity()
getCapacity
in interface LogBufferMBean
public long getInfoCount()
getInfoCount
in interface LogBufferMBean
protected void incInfoCount()
public int getLevel()
getLevel
in interface LogBufferMBean
public long getRecordCount()
getRecordCount
in interface LogBufferMBean
protected void incRecordCount()
public long getSevereCount()
getSevereCount
in interface LogBufferMBean
protected void incSevereCount()
public long getWarningCount()
getWarningCount
in interface LogBufferMBean
protected void incWarningCount()
public long getOtherCount()
getOtherCount
in interface LogBufferMBean
protected void incOtherCount()
public long getLatestDate()
getLatestDate
in interface LogBufferMBean
public void setCapacity(int records)
LogBufferMBean
setCapacity
in interface LogBufferMBean
records
- the capacity of the recordSetpublic void setLevel(int level)
setLevel
in interface LogBufferMBean
public String getRecent()
getRecent
in interface LogBufferMBean
public void postRegister(Boolean arg0)
postRegister
in interface MBeanRegistration
arg0
- Indicates whether or not the MBean has been successfully registeredpublic ObjectName preRegister(MBeanServer mbs, ObjectName on) throws MalformedObjectNameException
preRegister
in interface MBeanRegistration
mbs
- refernce to the MBeanon
- ObjectName provided by the creator of the MBean
MalformedObjectNameException
- could not create ObjectNamepublic void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
- pb. when deregisteringpublic void postDeregister()
postDeregister
in interface MBeanRegistration
protected void addToRecentLog(LogRecord record)
record
- LogRecord to be addprotected void addToLogRecordsQueue(LogRecord record)
record
- LogRecord to be addpublic int getRecentCapacity()
getRecentCapacity
in interface LogBufferMBean
public void setRecentCapacity(int recentCapacity)
setRecentCapacity
in interface LogBufferMBean
recentCapacity
- capacity of the recent LogRecord listprotected void setLatestDate(long latestDate)
public long getOldestDate()
getOldestDate
in interface LogBufferMBean
public void setOldestDate(long oldestDate)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |