cs138.service
Interface LogService

All Superinterfaces:
java.rmi.Remote

public interface LogService
extends java.rmi.Remote

This interface provides a remote service for centralized logging and working with various logs.

Author:
csiden

Nested Class Summary
static interface LogService.LogListener
          This is the interface of the LogListener.
 
Method Summary
 void addLogListener(LogService.LogListener lis)
          Adds a listener to be notified of changes to the log.
 void logMessage(LogMessage message)
          Logs a message with the centralized system.
 boolean removeLogListener(LogService.LogListener lis)
          Removes a listener from notifications of log changes.
 

Method Detail

addLogListener

void addLogListener(LogService.LogListener lis)
                    throws java.rmi.RemoteException
Adds a listener to be notified of changes to the log.

Parameters:
lis - The listener to be added
Throws:
java.rmi.RemoteException

removeLogListener

boolean removeLogListener(LogService.LogListener lis)
                          throws java.rmi.RemoteException
Removes a listener from notifications of log changes.

Parameters:
lis - The listener to remove
Returns:
True if successful, false if the listener was not found
Throws:
java.rmi.RemoteException

logMessage

void logMessage(LogMessage message)
                throws java.rmi.RemoteException
Logs a message with the centralized system. This will fire of all of the registered LogListeners. If no logListeners are currently defined it will end up holding all the messages until a LogListener shows up to consume them.

Parameters:
message - The message to log.
Throws:
java.rmi.RemoteException