Interface LogReaderService
-
public interface LogReaderServiceProvides methods to retrieveLogEntryobjects from the log.There are two ways to retrieve
LogEntryobjects:- 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:
LogEntry,LogListener,LogListener.logged(LogEntry)
- The primary way to retrieve
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddLogListener(LogListener listener)Subscribes toLogEntryobjects.java.util.EnumerationgetLog()Returns anEnumerationof allLogEntryobjects in the log.voidremoveLogListener(LogListener listener)Unsubscribes toLogEntryobjects.
-
-
-
Method Detail
-
addLogListener
void addLogListener(LogListener listener)
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:
LogListener,LogEntry,LogListener.logged(LogEntry)
-
removeLogListener
void removeLogListener(LogListener listener)
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:
LogListener
-
getLog
java.util.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.
-
-