org.eclipse.higgins.registry
Interface IConfiguration


public interface IConfiguration

If service provider requires to load its configuration from persistent storage it should provide an instance that implements this interface by IServiceProvider.getConfiguration(). Higgins Registry uses returned instance to load service provider configuration from persistent storage when service provider is registering in the registry.


Method Summary
 String getProperty(String key)
          Searches for the configuration property with the specified key in this configuration.
 String getProperty(String key, String defaultValue)
          Searches for the configuration property with the specified key in this configuration.
 Iterator getPropertyNames()
          Provides set of configuration property names.
 void load(File config)
          Loads configuration from the specified file.
 void save(File config)
          Saves configuration to the specified file.
 

Method Detail

load

public void load(File config)
Loads configuration from the specified file.

Parameters:
config - the file to load configuration from

save

public void save(File config)
Saves configuration to the specified file.

Parameters:
config - the file to store configuration

getPropertyNames

public Iterator getPropertyNames()
Provides set of configuration property names.

Returns:
an Iterable set of Strings

getProperty

public String getProperty(String key)
Searches for the configuration property with the specified key in this configuration. The method returns null if the property is not found.

Parameters:
key - the property key
Returns:
the value in this configuration with the specified key value

getProperty

public String getProperty(String key,
                          String defaultValue)
Searches for the configuration property with the specified key in this configuration. The method returns defaultValue if the property is not found.

Parameters:
key - the property key
defaultValue - a default value
Returns:
the value in this configuration with the specified key value