|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.server.Logger
This class handles all logging performed by the SLAMD server. It is a multithreaded component to allow changes to be logged with minimal impact on the performance of other components in the SLAMD server that use the logger (like the scheduler). However, configuration parameters make it possible to customize this behavior so that logging can be done synchronously if this is desired for some reason (e.g., debugging purposes). Note that minimal logging will be performed in this class to prevent logging loops, but any significant problems will be logged to standard error.
| Field Summary | |
static java.lang.String |
CONFIG_SUBSCRIBER_NAME
The name used to register the logger as a subscriber to the configuration handler. |
| Constructor Summary | |
Logger(SLAMDServer slamdServer)
Creates a new instance of a logger to work with the provided SLAMD server. |
|
| Method Summary | |
void |
closeLogger()
Sets a flag that indicates that the logger should stop operating. |
java.lang.String |
getSubscriberName()
Retrieves the name that the logger uses to subscribe to the configuration handler in order to be notified of configuration changes. |
ParameterList |
getSubscriberParameters()
Retrieves the set of configuration parameters associated with this configuration subscriber. |
void |
logMessage(java.lang.String message)
Performs the work of actually logging the specified message. |
void |
refreshSubscriberConfiguration()
Re-reads all configuration information used by the logger. |
void |
refreshSubscriberConfiguration(java.lang.String parameterName)
Re-reads the configuration for the specified parameter, if it is applicable to the logger. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String CONFIG_SUBSCRIBER_NAME
| Constructor Detail |
public Logger(SLAMDServer slamdServer)
throws SLAMDServerException
slamdServer - The SLAMD server instance with which this logger is to
be associated.
SLAMDServerException - If a problem is encountered while creating
the logger.| Method Detail |
public void logMessage(java.lang.String message)
message - The message to be written to the log.public void closeLogger()
public java.lang.String getSubscriberName()
getSubscriberName in interface ConfigSubscriberpublic ParameterList getSubscriberParameters()
getSubscriberParameters in interface ConfigSubscriber
public void refreshSubscriberConfiguration()
throws SLAMDServerException
If the name of the log file changes, then the logger writer will be closed and a new one opened with the specified name. There is no guarantee that any messages currently in the log buffer will be written to the original log file before it is closed (they may be written to the new log file instead).
refreshSubscriberConfiguration in interface ConfigSubscriberSLAMDServerException - If a new log filename is detected and there
is a problem while closing the existing log
file and/or opening the new one.
public void refreshSubscriberConfiguration(java.lang.String parameterName)
throws SLAMDServerException
If the name of the log file changes, then the logger writer will be closed and a new one opened with the specified name. There is no guarantee that any messages currently in the log buffer will be written to the original log file before it is closed (they may be written to the new log file instead).
refreshSubscriberConfiguration in interface ConfigSubscriberparameterName - The name of the parameter to be re-read from the
configuration.
SLAMDServerException - If a new log filename is detected and there
is a problem while closing the existing log
file and/or opening the new one.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||