com.tomgibara.pronto.logging.impl
Class LoggingConfigImpl

java.lang.Object
  extended by com.tomgibara.pronto.logging.LoggingConfig
      extended by com.tomgibara.pronto.logging.impl.LoggingConfigImpl

public class LoggingConfigImpl
extends LoggingConfig

The standard fulfilment of the LoggingConfig class.

Author:
Tom Gibara

Constructor Summary
LoggingConfigImpl()
           
 
Method Summary
 LoggingPolicy getPolicy()
          The policy currently in use by this object.
 com.tomgibara.pronto.config.ConfigSource getSource()
          The current source of configuration properties.
 void setPolicy(LoggingPolicy settings)
          Sets the policy for this object.
 void setSource(com.tomgibara.pronto.config.ConfigSource source)
          Sets the source of configuration properties for this object.
 void update()
          Causes the logging to be reconfigured immediately with the properties from the current configuration source.
 
Methods inherited from class com.tomgibara.pronto.logging.LoggingConfig
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingConfigImpl

public LoggingConfigImpl()
Method Detail

setPolicy

public void setPolicy(LoggingPolicy settings)
Description copied from class: LoggingConfig
Sets the policy for this object. Policies control global aspects of the objects operation. If null is supplied, a default policy is used. Changes to a policy may be expected to take effect instantaneously.

Specified by:
setPolicy in class LoggingConfig
Parameters:
settings - the policy to be used for this object, or null

getPolicy

public LoggingPolicy getPolicy()
Description copied from class: LoggingConfig
The policy currently in use by this object.

Specified by:
getPolicy in class LoggingConfig
Returns:
the current policy, never null

setSource

public void setSource(com.tomgibara.pronto.config.ConfigSource source)
Description copied from class: LoggingConfig
Sets the source of configuration properties for this object. Until this method is called with a non-null source, this object will not perform any actions. Calling this method with a source will cause the logging to be immediately reconfigured, unless the source supplied is the same as the object's current source, or is null, in which case no action is performed.

Specified by:
setSource in class LoggingConfig
Parameters:
source - the source of configuration information for the logging

getSource

public com.tomgibara.pronto.config.ConfigSource getSource()
Description copied from class: LoggingConfig
The current source of configuration properties.

Specified by:
getSource in class LoggingConfig
Returns:
the source of configuration for this object, may be null

update

public void update()
            throws ProntoLoggingException
Description copied from class: LoggingConfig
Causes the logging to be reconfigured immediately with the properties from the current configuration source. If the source for this object is null, no action is taken. This method may be useful if an application needs to respond to requests for logging configuration directly instead of polling for them (the default behaviour of this class). Note that the rate of polling can be adjusted (or stopped) with this object's policy.

Specified by:
update in class LoggingConfig
Throws:
ProntoLoggingException - if reconfiguration of the logging failed


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.