|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.config.support.AbstractConfigurationPropertiesFactory<T>
T
- the concrete type of the returned configuration properties.
@ThreadSafe public abstract class AbstractConfigurationPropertiesFactory<T extends ConfigurationPropertiesManagement>
Base implementation of the ConfigurationPropertiesFactory
.
Constructor Summary | |
---|---|
AbstractConfigurationPropertiesFactory() Default constructor. |
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. |
T |
create(ConfigurationKey key) Returns the configuration properties for the given key . |
T |
createDefault() Returns the configuration for the default key. |
ConfigurationPropertiesManagement |
createDefaultManagement() Returns the management view on a configuration for the default key. |
T |
createManagement(ConfigurationKey key) Returns the configuration properties for the given key . |
protected abstract T |
createNewConfiguration(ConfigurationKey key) Creates an empty instance of the configuration properties instance. |
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> |
matrialize() Materializes all configurations found by this factory. |
String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractConfigurationPropertiesFactory()
Method Detail |
---|
public final PropertyDescriptorRegistry getRegistry()
public final FactoryConfiguration getFactoryConfiguration()
ConfigurationPropertiesFactory
Since factories are not thread-safe according to configuration changes, it is expected that the factory is configured prior to any creation calls.
getFactoryConfiguration
in interface
ConfigurationPropertiesFactory
public final void addRootLocations(Collection<URL> urls)
ConfigurationPropertiesFactory
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.
addRootLocations
in interface
ConfigurationPropertiesFactory
urls
- the URLs to add as search location. If the list is empty or
urls
is
null
, nothing is added without a warning.
public final void addRootLocations(URL... urls)
ConfigurationPropertiesFactory
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.
addRootLocations
in interface
ConfigurationPropertiesFactory
urls
- the URLs to add as search location. If the list is empty or
urls
is
null
, nothing is added without a warning.
public final void addPropertyProviders(Collection<PropertyProvider> providers)
ConfigurationPropertiesFactory
Adding providers only affects later creations of ConfigurationProperties
instances.
addPropertyProviders
in interface
ConfigurationPropertiesFactory
providers
- property providers for additional property name-value pairs. If the list is empty or
providers
is
null
, nothing is added without a warning.
public final void addPropertyProviders(PropertyProvider... providers)
ConfigurationPropertiesFactory
Adding providers only affects later creations of ConfigurationProperties
instances.
addPropertyProviders
in interface
ConfigurationPropertiesFactory
providers
- property providers for additional property name-value pairs. If the list is empty or
providers
is
null
, nothing is added without a warning.
public Collection<ConfigurationKey> getRegisteredConfigurationKeys()
ConfigurationPropertiesFactory
getRegisteredConfigurationKeys
in interface
ConfigurationPropertiesFactory
public final T create(ConfigurationKey key) throws NullPointerException, ConfigurationException
ConfigurationPropertiesFactory
key
. May return a cached instance.
create
in interface
ConfigurationPropertiesFactory
key
- the identifier of the configuration properties that is requested.
null
.
NullPointerException
- if
key
is
null
.
ConfigurationException
- on any problem loading the configuration properties.
ConfigurationPropertiesFactory.createManagement(ConfigurationKey)
,
ConfigurationKeyHelper
public final T createDefault()
ConfigurationPropertiesFactory
createDefault
in interface
ConfigurationPropertiesFactory
null
.
public final ConfigurationPropertiesManagement createDefaultManagement()
ConfigurationPropertiesFactory
createDefaultManagement
in interface
ConfigurationPropertiesFactory
null
.
public final T createManagement(ConfigurationKey key) throws NullPointerException, ConfigurationException
ConfigurationPropertiesFactory
key
. May return a cached instance.
createManagement
in interface
ConfigurationPropertiesFactory
key
- the identifier of the configuration properties that is requested.
null
.
NullPointerException
- if
key
is
null
.
ConfigurationException
- on any problem loading the configuration properties.
ConfigurationPropertiesFactory.create(ConfigurationKey)
,
ConfigurationKeyHelper
public final Collection<ConfigurationKey> matrialize()
ConfigurationPropertiesFactory
matrialize
in interface
ConfigurationPropertiesFactory
null
.
protected abstract T createNewConfiguration(ConfigurationKey key) throws NullPointerException, ConfigurationException
key
- the key to the instance.
null
.
NullPointerException
- if
key
is
null
.
ConfigurationException
- if the configuration cannot be created.
public String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |