Package com.gurock.smartinspect
Class ConfigurationTimer
- java.lang.Object
-
- com.gurock.smartinspect.ConfigurationTimer
-
public class ConfigurationTimer extends Object
A configurable timer for monitoring and reloading SmartInspect configuration files on changes.Use this class to monitor and automatically reload SmartInspect configuration files. This timer periodically checks if the related configuration file has changed (by comparing the last write time) and automatically tries to reload the configuration properties. You can pass the SmartInspect object to configure, the name of the configuration file to monitor and the interval in which this timer should check for changes.
For information about SmartInspect configuration files, please refer to the documentation of the SmartInspect.loadConfiguration method.
This class is fully threadsafe.
-
-
Constructor Summary
Constructors Constructor Description ConfigurationTimer(SmartInspect smartInspect, String fileName, int period)Creates and initializes a new ConfigurationTimer object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()The method releases all resources of this ConfigurationTimer object and stops monitoring the SmartInspect configuration file for changes.
-
-
-
Constructor Detail
-
ConfigurationTimer
public ConfigurationTimer(SmartInspect smartInspect, String fileName, int period)
Creates and initializes a new ConfigurationTimer object.- Parameters:
smartInspect- The SmartInspect object to configure.fileName- The name of the configuration file to monitor.period- The milliseconds interval in which this timer should check for changes.- Throws:
NullPointerException- if the smartInspect or fileName parameter is null.IllegalArgumentException- if the period parameter is negative.
-
-