dk.netarkivet.monitor.logging
Class CachingLogRecord

java.lang.Object
  extended by dk.netarkivet.monitor.logging.CachingLogRecord
All Implemented Interfaces:
SingleLogRecord

public class CachingLogRecord
extends java.lang.Object
implements SingleLogRecord

A LogRecord to be exposed as an MBean.


Constructor Summary
CachingLogRecord(int index, CachingLogHandler cachingLogHandler)
          Make a caching log record, that exposes a log record at a given index as an MBean.
 
Method Summary
 void close()
          Unregisters this object as an mbean.
 java.lang.String getRecordString()
          Get the log record on a given index from the top as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingLogRecord

public CachingLogRecord(int index,
                        CachingLogHandler cachingLogHandler)
Make a caching log record, that exposes a log record at a given index as an MBean.

Parameters:
index - The index of this log record, counted from the top of the list.
cachingLogHandler - The caching log handler this is an exposing view on.
Throws:
IOFailure - on any trouble registering.
Method Detail

getRecordString

public java.lang.String getRecordString()
Get the log record on a given index from the top as a string. This will be formatted by the formatter from the CachingLogHandler.

Specified by:
getRecordString in interface SingleLogRecord
Returns:
A String representation of the LogRecord, or null for none.

close

public void close()
Unregisters this object as an mbean.