Class Configurable

java.lang.Object
i5.las2peer.api.Configurable
Direct Known Subclasses:
Connector, Node, RegistryConfiguration, Service, SharedStorage

public abstract class Configurable extends Object
Base (abstract) super type for classes that may be configurable via property files. The basic idea is, that the runtime system will look for .property files in the current runtime directory or the subdirectories ./config, ./etc and ./properties for a file named as the sub class of Configurable (including the package name). All protected (non-static) fields can be set via the setFieldValues() method. This won't be done automatically, since subclasses may want to add some extra configuration behavior.
  • Constructor Details

    • Configurable

      public Configurable()
  • Method Details

    • getProperties

      protected final Hashtable<String,String> getProperties()
      Tries to find a (service) class specific property file The following dirs will be checked:
      • ./
      • ./config/
      • ./etc/
      • ./properties/
      The name of the property file is the name of the implementing service class followed by .properties.
      Returns:
      hashtable with all property entries
    • setFieldValues

      protected void setFieldValues()
      Sets all field values from the classes property file. This method uses getProperties() to get the value stored in the classes property file to set all fields with the name of the properties. Note that the name "monitor" is reserved to switch the monitoring on and off.