LogReaderService

Syntax

public interface LogReaderService

Description

The LogReaderService provides methods to read LogEntry objects from the log. Two ways are provided to read LogEntry objects.

The primary way to receive LogEntry objects is to register a LogListener object which will be called at the LogListener.logged(LogEntry) method for each entry added to the log.

To receive past LogEntry objects, getLog() can be called which will return an Enumeration of all LogEntry objects in the log.

Member Summary
Methods
public voidaddLogListener(LogListener)
 Subscribe to LogEntry objects.
public EnumerationgetLog()
 Returns an enumeration of all LogEntry objects in the log.
public voidremoveLogListener(LogListener)
 Unsubscribe to LogEntry objects.

Methods

addLogListener(LogListener)
public void addLogListener(LogListener listener)

Subscribe to LogEntry objects. Registers a LogListener object with the LogReaderService. This object will be called at the LogListener.logged (LogEntry) method for each LogEntry placed into the log.

When a bundle which registers a LogListener is stopped or otherwise releases the LogReaderService, the LogReaderService must remove all the bundle's listeners.

Parameters:

listener— A LogListener object to register to receive LogEntry object's.

getLog()
public java.util.Enumeration getLog()

Returns an enumeration of all LogEntry objects in the log. Each element of the enumeration is a LogEntry object. The LogEntries will be ordered with the most recent entry first. Whether the enumeration is of all LogEntry objects since the LogService was started or some recent past is implementation specific. It is also implementation specific as to whether informational and debug LogEntry objects are included in the enumeration.

removeLogListener(LogListener)
public void removeLogListener(LogListener listener)

Unsubscribe to LogEntry objects. Unregisters a LogListener object from the LogReaderService.

Parameters:

listener— A LogListener object to unregister.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.0.85