public interface LogReaderService
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 void | addLogListener(LogListener) |
Subscribe to LogEntry objects. | |
public Enumeration | getLog() |
Returns an enumeration of all LogEntry objects in the log. | |
public void | removeLogListener(LogListener) |
Unsubscribe to LogEntry objects. |
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.
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.
public void removeLogListener(LogListener listener)
Unsubscribe to LogEntry objects. Unregisters a LogListener object from the LogReaderService.
Parameters:
3.143.0.85