de.smartics.properties.api.config.app
Interface ConfigurationPropertiesFactory

Package class diagram package ConfigurationPropertiesFactory
All Superinterfaces:
Serializable
All Known Subinterfaces:
ConfigurationPropertiesManagementFactory
All Known Implementing Classes:
AbstractConfigurationPropertiesFactory, AutodetectDataSourceConfigurationPropertiesFactory, AutodetectDataSourceResourceConfigurationPropertiesFactory, ClasspathConfigurationPropertiesFactory, DataSourceConfigurationPropertiesFactory, JndiConfigurationPropertiesFactory, PropertiesConfigurationPropertiesFactory, ResourceConfigurationPropertiesFactory

public interface ConfigurationPropertiesFactory
     
     
extends Serializable

Interface to create instances of ConfigurationProperties.

Implementations require to provide a public constructor without arguments.


Method Summary
 void addPropertyProviders(Collection<PropertyProvider> providers)
          Adds the given providers of properties as additional property definitions.
 void addPropertyProviders(PropertyProvider... providers)
          Adds the given providers of properties as additional property definitions.
 void addRootLocations(Collection<URL> urls)
          Adds the given URLs to the locations to search for property declarations and definitions.
 void addRootLocations(URL... urls)
          Adds the given additional URLs to the locations to search for property declarations and definitions.
 ConfigurationProperties create(ConfigurationKey<?> key)
          Returns the configuration properties for the given key.
 ConfigurationProperties createDefault()
          Returns the configuration for the default key.
 ConfigurationPropertiesManagement createDefaultManagement()
          Returns the management view on a configuration for the default key.
 ConfigurationPropertiesManagement createManagement(ConfigurationKey<?> key)
          Returns the configuration properties for the given key.
 FactoryConfiguration getFactoryConfiguration()
          Returns the factory configuration and changes values.
 Collection<ConfigurationKey<?>> getRegisteredConfigurationKeys()
          Returns a list of keys to the registered configurations.
 PropertyDescriptorRegistry getRegistry()
          Returns the registry of declarations used by all created configurations.
 Collection<ConfigurationKey<?>> materialize()
          Materializes all configurations found by this factory.
 

Method Detail

getFactoryConfiguration

FactoryConfiguration getFactoryConfiguration()
Returns the factory configuration and changes values.

Since factories are not thread-safe according to configuration changes, it is expected that the factory is configured prior to any creation calls.

Returns:
a reference to the factory configuration.

addRootLocations

void addRootLocations(Collection<URL> urls)
Adds the given URLs to the locations to search for property declarations and definitions. Property definitions are e.g. properties files or similar resources that define the actual value of a property.

Adding URLs only affects later creations of ConfigurationProperties instances.

Parameters:
urls - the URLs to add as search location. If the list is empty or urls is null, nothing is added without a warning.

addRootLocations

void addRootLocations(URL... urls)
Adds the given additional URLs to the locations to search for property declarations and definitions. Property definitions are e.g. properties files or similar resources that define the actual value of a property.

Adding URLs only affects later creations of ConfigurationProperties instances.

Parameters:
urls - the URLs to add as search location. If the list is empty or urls is null, nothing is added without a warning.

addPropertyProviders

void addPropertyProviders(Collection<PropertyProvider> providers)
Adds the given providers of properties as additional property definitions.

Adding providers only affects later creations of ConfigurationProperties instances.

Parameters:
providers - property providers for additional property name-value pairs. If the list is empty or providers is null, nothing is added without a warning.

addPropertyProviders

void addPropertyProviders(PropertyProvider... providers)
Adds the given providers of properties as additional property definitions.

Adding providers only affects later creations of ConfigurationProperties instances.

Parameters:
providers - property providers for additional property name-value pairs. If the list is empty or providers is null, nothing is added without a warning.

create

ConfigurationProperties create(ConfigurationKey<?> key)
                               throws NullPointerException,
                                      ConfigurationException
Returns the configuration properties for the given key. May return a cached instance.

Parameters:
key - the identifier of the configuration properties that is requested.
Returns:
the requested configuration properties. Never null.
Throws:
NullPointerException - if key is null.
ConfigurationException - on any problem loading the configuration properties.
See Also:
createManagement(ConfigurationKey), EnvAppConfigurationKeyHelper

createManagement

ConfigurationPropertiesManagement createManagement(ConfigurationKey<?> key)
                                                   throws NullPointerException,
                                                          ConfigurationException
Returns the configuration properties for the given key. May return a cached instance.

Parameters:
key - the identifier of the configuration properties that is requested.
Returns:
the requested configuration properties. Never null.
Throws:
NullPointerException - if key is null.
ConfigurationException - on any problem loading the configuration properties.
See Also:
create(ConfigurationKey), EnvAppConfigurationKeyHelper

createDefault

ConfigurationProperties createDefault()
                                      throws ConfigurationException
Returns the configuration for the default key. The default key is not associated with a particular environment or application.

Returns:
the requested configuration properties. Never null.
Throws:
ConfigurationException - on any problem loading the configuration properties.

createDefaultManagement

ConfigurationPropertiesManagement createDefaultManagement()
                                                          throws ConfigurationException
Returns the management view on a configuration for the default key. The default key is not associated with a particular environment or application.

Returns:
the requested configuration properties. Never null.
Throws:
ConfigurationException - on any problem loading the configuration properties.

getRegisteredConfigurationKeys

Collection<ConfigurationKey<?>> getRegisteredConfigurationKeys()
Returns a list of keys to the registered configurations.

Returns:
the list of configuration keys.

getRegistry

PropertyDescriptorRegistry getRegistry()
Returns the registry of declarations used by all created configurations.

Returns:
the registry of declarations used by all created configurations.

materialize

Collection<ConfigurationKey<?>> materialize()
Materializes all configurations found by this factory.

Returns:
the collection of keys of the materialized configuration. May be empty, but is never null.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.