org.apache.commons.configuration.reloading

Class ManagedReloadingStrategy

public class ManagedReloadingStrategy extends Object implements ReloadingStrategy, ManagedReloadingStrategyMBean

A strategy to reload configuration based on management requests. Designed for JMX management.

Author: Nicolas De loof

Field Summary
FileConfigurationconfiguration
Stores a reference to the associated configuration.
Loglog
The logger.
booleanreloadingRequired
A flag whether a reload is required.
Method Summary
voidinit()
voidrefresh()
Tells this strategy that the monitored configuration file should be refreshed.
voidreloadingPerformed()
booleanreloadingRequired()
Checks whether reloading is required.
voidsetConfiguration(FileConfiguration configuration)
Sets the associated configuration.

Field Detail

configuration

private FileConfiguration configuration
Stores a reference to the associated configuration.

log

private Log log
The logger.

reloadingRequired

private boolean reloadingRequired
A flag whether a reload is required.

Method Detail

init

public void init()

See Also: init

refresh

public void refresh()
Tells this strategy that the monitored configuration file should be refreshed. This method will typically be called from outside (through an exposed MBean) on behalf of an administrator.

See Also: refresh

reloadingPerformed

public void reloadingPerformed()

See Also: reloadingPerformed

reloadingRequired

public boolean reloadingRequired()
Checks whether reloading is required. This implementation checks whether the refresh() method has been invokded.

Returns: a flag whether reloading is required

See Also: reloadingRequired

setConfiguration

public void setConfiguration(FileConfiguration configuration)
Sets the associated configuration.

Parameters: configuration the associated configuration