org.ops4j.pax.logging.service.internal
Class LogReaderServiceImpl

java.lang.Object
  extended by org.ops4j.pax.logging.service.internal.LogReaderServiceImpl
All Implemented Interfaces:
LogReaderService

public class LogReaderServiceImpl
extends java.lang.Object
implements LogReaderService


Constructor Summary
LogReaderServiceImpl(int maxEntries)
           
 
Method Summary
 void addLogListener(LogListener logListener)
          Subscribes to LogEntry objects.
 java.util.Enumeration getLog()
          Returns an Enumeration of all LogEntry objects in the log.
 void removeLogListener(LogListener logListener)
          Unsubscribes to LogEntry objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogReaderServiceImpl

public LogReaderServiceImpl(int maxEntries)
Method Detail

addLogListener

public void addLogListener(LogListener logListener)
Description copied from interface: LogReaderService
Subscribes to LogEntry objects.

This method registers a LogListener object with the Log Reader Service. The LogListener.logged(LogEntry) method will be called for each LogEntry object placed into the log.

When a bundle which registers a LogListener object is stopped or otherwise releases the Log Reader Service, the Log Reader Service must remove all of the bundle's listeners.

If this Log Reader Service's list of listeners already contains a listener l such that (l==listener), this method does nothing.

Specified by:
addLogListener in interface LogReaderService
Parameters:
logListener - A LogListener object to register; the LogListener object is used to receive LogEntry objects.
See Also:
LogListener, LogEntry, LogListener.logged(LogEntry)

removeLogListener

public void removeLogListener(LogListener logListener)
Description copied from interface: LogReaderService
Unsubscribes to LogEntry objects.

This method unregisters a LogListener object from the Log Reader Service.

If listener is not contained in this Log Reader Service's list of listeners, this method does nothing.

Specified by:
removeLogListener in interface LogReaderService
Parameters:
logListener - A LogListener object to unregister.
See Also:
LogListener

getLog

public java.util.Enumeration getLog()
Description copied from interface: LogReaderService
Returns an Enumeration of all LogEntry objects in the log.

Each element of the enumeration is a LogEntry object, ordered with the most recent entry first. Whether the enumeration is of all LogEntry objects since the Log Service was started or some recent past is implementation-specific. Also implementation-specific is whether informational and debug LogEntry objects are included in the enumeration.

Specified by:
getLog in interface LogReaderService
Returns:
An Enumeration of all LogEntry objects in the log.


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.