JComet 0.1 Getting started
org.jcomet.dynamic.DynamicProperties
This object extends java.util.Properties and can monitor its source configuration file and reload when even it is modified. It is also provides the ability to register listeners that are notified when properties change.
- Add jcomet.jar into your classpath.
- Create a DynamicProperties and register a listener using the setPropertyChangedListener(..) method.
- Use load(File propFile, long monitorInterval) to load the properties, the DynamicProperties with check the file for changes every monitorInterval milliseconds.
- Alternatively, use load(java.io.File propFile) to load the properties. the DynamicProperties with check the file for changes. you will need to manually reload the DynamicProperties.
- Do not use load(InputStream inStream), it is kept for internal use.
- If you want to manually reload the DynamicProperties invoke the reload() method.
- The PropertyChangedListener registered to this object will be notified of any changes to the properties.
See JComet release for code example of how to use this object.