de.smartics.properties.spi.config.support
Interface ConfigurationPropertiesManagementFactory

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

public interface ConfigurationPropertiesManagementFactory
     
     
extends ConfigurationPropertiesFactory

Factory to create instances of ConfigurationPropertiesManagement.


Method Summary
 String addRootUrls(ArtifactId artifactId)
          Adds the URLs derived from the dependencies provided by the given artifactId to the locations to search for property declarations and definitions.
 ConfigurationPropertiesManagement create(ConfigurationKey<?> key)
          Creates the configuration properties instance for the given key.
 ArtifactRef getArtifactRef(String artifactId)
          Returns the artifact reference by its short ID.
 void release()
          Releases resources acquired by this instance.
 ConfigurationPropertiesManagement remove(ConfigurationKey<?> key)
          Removes the configuration with the given key from the cache.
 
Methods inherited from interface de.smartics.properties.api.config.app.ConfigurationPropertiesFactory
addPropertyProviders, addPropertyProviders, addRootLocations, addRootLocations, createDefault, createDefaultManagement, createManagement, getFactoryConfiguration, getRegisteredConfigurationKeys, getRegistry, materialize
 

Method Detail

create

ConfigurationPropertiesManagement create(ConfigurationKey<?> key)
                                         throws NullPointerException
Creates the configuration properties instance for the given key.

Specified by:
create in interface ConfigurationPropertiesFactory
Parameters:
key - the key to identify the requested configuration.
Returns:
the requested configuration.
Throws:
NullPointerException - if key is null.
See Also:
ConfigurationPropertiesFactory.createManagement(ConfigurationKey), EnvAppConfigurationKeyHelper

remove

ConfigurationPropertiesManagement remove(ConfigurationKey<?> key)
                                         throws NullPointerException
Removes the configuration with the given key from the cache.

Parameters:
key - the key of the configuration to remove.
Returns:
a reference to the removed configuration.
Throws:
NullPointerException - if key is null.

release

void release()
Releases resources acquired by this instance.


addRootUrls

String addRootUrls(ArtifactId artifactId)
                   throws de.smartics.util.lang.NullArgumentException,
                          RepositoryException,
                          CompoundConfigurationException
Adds the URLs derived from the dependencies provided by the given 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.

Parameters:
artifactId - the reference to the property resources.
Returns:
the URL to the remote repository to fetch the artifact.
Throws:
de.smartics.util.lang.NullArgumentException - if artifactId is null.
RepositoryException - on any problem accessing the remote repository.
CompoundConfigurationException - if loading property resources encountered problems.

getArtifactRef

@CheckForNull
ArtifactRef getArtifactRef(String artifactId)
                           throws NullPointerException
Returns the artifact reference by its short ID.

Implementation Notes:
The registered artifacts are traversed in order they have been registered. The first class path environment that references the artifact with the given artifactId is returned.
Parameters:
artifactId - the GAV concatenated and separated by colons.
Returns:
the associated artifact reference or null if there is no artifact reference with the given artifactId registered.
Throws:
NullPointerException - if artifactId is null.


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