Interface LogReaderService
LogEntry objects from the log.
There are two ways to retrieve LogEntry objects:
- The primary way to retrieve
LogEntryobjects is to register aLogListenerobject whoseLogListener.loggedmethod will be called for each entry added to the log. - To retrieve past
LogEntryobjects, thegetLogmethod can be called which will return anEnumerationof allLogEntryobjects in the log.
- Version:
- $Revision: 5654 $
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddLogListener(LogListener listener) Subscribes toLogEntryobjects.getLog()Returns anEnumerationof allLogEntryobjects in the log.voidremoveLogListener(LogListener listener) Unsubscribes toLogEntryobjects.
-
Method Details
-
addLogListener
Subscribes toLogEntryobjects.This method registers a
LogListenerobject with the Log Reader Service. TheLogListener.logged(LogEntry)method will be called for eachLogEntryobject placed into the log.When a bundle which registers a
LogListenerobject 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
lsuch that(l==listener), this method does nothing.- Parameters:
listener- ALogListenerobject to register; theLogListenerobject is used to receiveLogEntryobjects.- See Also:
-
removeLogListener
Unsubscribes toLogEntryobjects.This method unregisters a
LogListenerobject from the Log Reader Service.If
listeneris not contained in this Log Reader Service's list of listeners, this method does nothing.- Parameters:
listener- ALogListenerobject to unregister.- See Also:
-
getLog
Enumeration getLog()Returns anEnumerationof allLogEntryobjects in the log.Each element of the enumeration is a
LogEntryobject, ordered with the most recent entry first. Whether the enumeration is of allLogEntryobjects since the Log Service was started or some recent past is implementation-specific. Also implementation-specific is whether informational and debugLogEntryobjects are included in the enumeration.- Returns:
- An
Enumerationof allLogEntryobjects in the log.
-