public abstract class AbstractArchiverCache extends java.lang.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(java.lang.Object component)
Add an archive this Log Archiver.
|
void |
addEvent(java.lang.String archive,
LogLevel level,
java.lang.String message)
Add an event to the cache.
|
void |
addLogListener(LogListener l,
java.lang.Object component,
LogLevel level,
long last,
int history)
Add a listener.
|
abstract void |
destroy() |
long |
getLastMessageNumber(java.lang.String archive) |
int |
getMaxHistory() |
protected ArchiveNameResolver |
getResolver() |
boolean |
hasArchive(java.lang.String archive)
Does this Archiver contain the given archive.
|
protected boolean |
hasArchiveFor(java.lang.Object component) |
protected void |
removeArchive(java.lang.Object component)
Remove an archive from this LogArchive.
|
void |
removeLogListener(LogListener l,
java.lang.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(java.lang.String archive)
getLastMessageNumber
in interface LogArchiverCache
public void addLogListener(LogListener l, java.lang.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, java.lang.Object component)
removeLogListener
in interface LogArchiverCache
l
- The listener.archive
- The archive.public boolean hasArchive(java.lang.String archive)
hasArchive
in interface LogArchiverCache
archive
- The archive.protected boolean hasArchiveFor(java.lang.Object component)
protected ArchiveNameResolver getResolver()
protected void addArchive(java.lang.Object component)
archive
- The archive name.protected void removeArchive(java.lang.Object component)
archive
- public void addEvent(java.lang.String archive, LogLevel level, java.lang.String message)
addEvent
in interface LogArchiverCache
archive
- The archive.level
- The level.message
- The message.public abstract void destroy()
destroy
in interface LogArchiverCache