|
||||||||||
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 ConfigurationPropertiesManagementFactory
.
Constructor Summary | |
---|---|
protected |
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. |
String |
addRootUrls(de.smartics.properties.resource.domain.ArtifactId artifactId) Adds the URLs derived from the dependencies provided by the given artifactId to the locations to search for property declarations and definitions. |
T |
create(ConfigurationKey<?> key) Creates the configuration properties instance 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. |
de.smartics.properties.resource.domain.ArtifactRef |
getArtifactRef(String artifactId) Returns the artifact reference by its short ID. |
FactoryConfiguration |
getFactoryConfiguration() Returns the factory configuration and changes values. |
Collection<ConfigurationKey<?>> |
getRegisteredConfigurationKeys() Returns a list of keys to the registered configurations. |
de.smartics.properties.api.core.domain.PropertyDescriptorRegistry |
getRegistry() Returns the registry of declarations used by all created configurations. |
Collection<ConfigurationKey<?>> |
materialize() Materializes all configurations found by this factory. |
void |
release() Releases resources acquired by this instance. |
ConfigurationPropertiesManagement |
remove(ConfigurationKey<?> key) Removes the configuration with the given key from the cache. |
String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractConfigurationPropertiesFactory()
Method Detail |
---|
public final de.smartics.properties.api.core.domain.PropertyDescriptorRegistry getRegistry()
ConfigurationPropertiesFactory
getRegistry
in interface
ConfigurationPropertiesFactory
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 final String addRootUrls(de.smartics.properties.resource.domain.ArtifactId artifactId) throws de.smartics.util.lang.NullArgumentException, de.smartics.properties.resource.repository.RepositoryException, CompoundConfigurationException
ConfigurationPropertiesManagementFactory
artifactId
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.
addRootUrls
in interface
ConfigurationPropertiesManagementFactory
artifactId
- the reference to the property resources.
de.smartics.util.lang.NullArgumentException
- if
artifactId
is
null
.
de.smartics.properties.resource.repository.RepositoryException
- on any problem accessing the remote repository.
CompoundConfigurationException
- if loading property resources encountered problems.
public final de.smartics.properties.resource.domain.ArtifactRef getArtifactRef(String artifactId) throws NullPointerException
ConfigurationPropertiesManagementFactory
getArtifactRef
in interface
ConfigurationPropertiesManagementFactory
artifactId
- the GAV concatenated and separated by colons.
null
if there is no artifact reference with the given
artifactId
registered.
NullPointerException
- if
artifactId
is
null
.
public final Collection<ConfigurationKey<?>> getRegisteredConfigurationKeys()
ConfigurationPropertiesFactory
getRegisteredConfigurationKeys
in interface
ConfigurationPropertiesFactory
public final T create(ConfigurationKey<?> key) throws NullPointerException, ConfigurationException
ConfigurationPropertiesManagementFactory
create
in interface
ConfigurationPropertiesFactory
create
in interface
ConfigurationPropertiesManagementFactory
key
- the key to identify the requested configuration.
NullPointerException
- if
key
is
null
.
ConfigurationException
- on any problem loading the configuration properties.
ConfigurationPropertiesFactory.createManagement(ConfigurationKey)
,
EnvAppConfigurationKeyHelper
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)
,
EnvAppConfigurationKeyHelper
public Collection<ConfigurationKey<?>> materialize()
ConfigurationPropertiesFactory
materialize
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 void release()
ConfigurationPropertiesManagementFactory
release
in interface
ConfigurationPropertiesManagementFactory
public final ConfigurationPropertiesManagement remove(ConfigurationKey<?> key) throws NullPointerException
ConfigurationPropertiesManagementFactory
remove
in interface
ConfigurationPropertiesManagementFactory
key
- the key of the configuration to remove.
NullPointerException
- if
key
is
null
.
public String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |