public abstract class AbstractArchiverCache extends Object implements LogArchiverCache
Constructor and Description |
---|
AbstractArchiverCache(ArchiveNameResolver resolver)
Default constructor.
|
AbstractArchiverCache(ArchiveNameResolver resolver,
int maxHistory)
Construct a LogArchiver with the given amount of history.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addArchive(Object component)
Add an archive this Log Archiver.
|
void |
addEvent(String archive,
LogLevel level,
String message)
Add an event to the cache.
|
void |
addLogListener(LogListener l,
Object component,
LogLevel level,
long last,
int history)
Add a listener.
|
abstract void |
destroy() |
long |
getLastMessageNumber(String archive) |
int |
getMaxHistory() |
protected ArchiveNameResolver |
getResolver() |
boolean |
hasArchive(String archive)
Does this Archiver contain the given archive.
|
protected boolean |
hasArchiveFor(Object component) |
protected void |
removeArchive(Object component)
Remove an archive from this LogArchive.
|
void |
removeLogListener(LogListener l,
Object component)
Remove a listener.
|
public AbstractArchiverCache(ArchiveNameResolver resolver)
public AbstractArchiverCache(ArchiveNameResolver resolver, int maxHistory)
maxHistory
- The number of lines to store for each loggerpublic int getMaxHistory()
getMaxHistory
in interface LogArchiverCache
public long getLastMessageNumber(String archive)
getLastMessageNumber
in interface LogArchiverCache
public void addLogListener(LogListener l, Object component, LogLevel level, long last, int history)
addLogListener
in interface LogArchiverCache
l
- The listenerarchive
- The componentlevel
- The levellast
- The last message number.history
- The max messages required.public void removeLogListener(LogListener l, Object component)
removeLogListener
in interface LogArchiverCache
l
- The listener.archive
- The archive.public boolean hasArchive(String archive)
hasArchive
in interface LogArchiverCache
archive
- The archive.protected boolean hasArchiveFor(Object component)
protected ArchiveNameResolver getResolver()
protected void addArchive(Object component)
archive
- The archive name.protected void removeArchive(Object component)
archive
- public void addEvent(String archive, LogLevel level, String message)
addEvent
in interface LogArchiverCache
archive
- The archive.level
- The level.message
- The message.public abstract void destroy()
destroy
in interface LogArchiverCache