Class ManagedReloadingStrategy
- java.lang.Object
-
- org.apache.commons.configuration.reloading.ManagedReloadingStrategy
-
- All Implemented Interfaces:
ManagedReloadingStrategyMBean,ReloadingStrategy
public class ManagedReloadingStrategy extends java.lang.Object implements ReloadingStrategy, ManagedReloadingStrategyMBean
A strategy to reload configuration based on management requests. Designed for JMX management.- Version:
- $Id: ManagedReloadingStrategy.java 1210646 2011-12-05 21:25:01Z oheger $
- Author:
- Nicolas De loof
-
-
Constructor Summary
Constructors Constructor Description ManagedReloadingStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit()Initialize the strategy.voidrefresh()Tells this strategy that the monitored configuration file should be refreshed.voidreloadingPerformed()Notify the strategy that the file has been reloaded.booleanreloadingRequired()Checks whether reloading is required.voidsetConfiguration(FileConfiguration configuration)Sets the associated configuration.
-
-
-
Constructor Detail
-
ManagedReloadingStrategy
public ManagedReloadingStrategy()
-
-
Method Detail
-
init
public void init()
Description copied from interface:ReloadingStrategyInitialize the strategy.- Specified by:
initin interfaceReloadingStrategy- See Also:
ReloadingStrategy.init()
-
reloadingPerformed
public void reloadingPerformed()
Description copied from interface:ReloadingStrategyNotify the strategy that the file has been reloaded.- Specified by:
reloadingPerformedin interfaceReloadingStrategy- See Also:
ReloadingStrategy.reloadingPerformed()
-
reloadingRequired
public boolean reloadingRequired()
Checks whether reloading is required. This implementation checks whether therefresh()method has been invoked.- Specified by:
reloadingRequiredin interfaceReloadingStrategy- Returns:
- a flag whether reloading is required
- See Also:
ReloadingStrategy.reloadingRequired()
-
setConfiguration
public void setConfiguration(FileConfiguration configuration)
Sets the associated configuration.- Specified by:
setConfigurationin interfaceReloadingStrategy- Parameters:
configuration- the associated configuration
-
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.- Specified by:
refreshin interfaceManagedReloadingStrategyMBean- See Also:
ManagedReloadingStrategyMBean.refresh()
-
-