JComet getting started

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.

  1. Add jcomet.jar into your classpath.
  2. Create a DynamicProperties and register a listener using the setPropertyChangedListener(..) method.
  3. Use load(File propFile, long monitorInterval) to load the properties, the DynamicProperties with check the file for changes every monitorInterval milliseconds.
  4. 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.
  5. Do not use load(InputStream inStream), it is kept for internal use.
  6. If you want to manually reload the DynamicProperties invoke the reload() method.
  7. 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.

Post a comment