org.jboss.osgi.spi.logging
Class LogEntryCache

java.lang.Object
  extended by org.jboss.osgi.spi.logging.LogEntryCache
All Implemented Interfaces:
java.util.EventListener, org.osgi.service.log.LogListener

public class LogEntryCache
extends java.lang.Object
implements org.osgi.service.log.LogListener

A LogListener that caches LogEntry objects for later retrieval. The entries can be filtered with a list of LogEntryFilter instances. A log entry is cached if it matches at least one of the registered filters. If there is no filter registered entries are cached unconditionally.

Since:
09-Apr-2009
Author:
thomas.diesler@jboss.com

Constructor Summary
LogEntryCache()
          Create a LogEntryCache with no associated filters
LogEntryCache(LogEntryFilter filter)
          Create a LogEntryCache with a single associated filter
 
Method Summary
 void addFilter(LogEntryFilter filter)
          Add a LogEntryFilter
 void clear()
          Clear the list of cached entries.
 void clearFilters()
          Clear the list of registered filters.
 java.util.List<org.osgi.service.log.LogEntry> getLog()
          Get the list of cached entries.
 java.util.List<org.osgi.service.log.LogEntry> getLog(boolean clear)
          Get the list of cached entries and optionally clears the list.
 void logged(org.osgi.service.log.LogEntry entry)
          Listener method called for each LogEntry object created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogEntryCache

public LogEntryCache(LogEntryFilter filter)
Create a LogEntryCache with a single associated filter


LogEntryCache

public LogEntryCache()
Create a LogEntryCache with no associated filters

Method Detail

addFilter

public void addFilter(LogEntryFilter filter)
Add a LogEntryFilter


clear

public void clear()
Clear the list of cached entries.


clearFilters

public void clearFilters()
Clear the list of registered filters.


getLog

public java.util.List<org.osgi.service.log.LogEntry> getLog()
Get the list of cached entries. Note, that the LogService delivers LogEntries asynchronously. Client should not rely on a certain LogEntry already beein delivered when calling this method.


getLog

public java.util.List<org.osgi.service.log.LogEntry> getLog(boolean clear)
Get the list of cached entries and optionally clears the list. Note, that the LogService delivers LogEntries asynchronously. Client should not rely on a certain LogEntry already beein delivered when calling this method.


logged

public void logged(org.osgi.service.log.LogEntry entry)
Listener method called for each LogEntry object created.

Specified by:
logged in interface org.osgi.service.log.LogListener


Copyright © 2009. All Rights Reserved.