de.smartics.properties.impl.config.resource
Class ResourceConfigurationPropertiesFactory

Package class diagram package ResourceConfigurationPropertiesFactory
java.lang.Object
  extended by de.smartics.properties.spi.config.support.AbstractConfigurationPropertiesFactory<ConfigurationPropertiesManagement>
      extended by de.smartics.properties.impl.config.resource.ResourceConfigurationPropertiesFactory
All Implemented Interfaces:
ConfigurationPropertiesFactory, Serializable

@ThreadSafe
public final class ResourceConfigurationPropertiesFactory
     
     
extends AbstractConfigurationPropertiesFactory< ConfigurationPropertiesManagement>

Factory to create instances of ConfigurationPropertiesManagement.

See Also:
Serialized Form

Constructor Summary
ResourceConfigurationPropertiesFactory()
          Default constructor.
 
Method Summary
 void 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.
protected  ConfigurationPropertiesManagement createNewConfiguration(ConfigurationKey key)
          Creates an empty instance of the configuration properties instance.
 ArtifactRef getArtifactRef(String artifactId)
          Returns the artifact reference by its short ID.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class de.smartics.properties.spi.config.support.AbstractConfigurationPropertiesFactory
addPropertyProviders, addPropertyProviders, addRootLocations, addRootLocations, create, createDefault, createDefaultManagement, createManagement, getFactoryConfiguration, getRegisteredConfigurationKeys, getRegistry, matrialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceConfigurationPropertiesFactory

public ResourceConfigurationPropertiesFactory()
Default constructor.

Method Detail

addRootUrls

public void 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.
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.

createNewConfiguration

protected ConfigurationPropertiesManagement createNewConfiguration(ConfigurationKey key)
                                                            throws NullPointerException,
                                                                   ConfigurationException
Description copied from class: AbstractConfigurationPropertiesFactory
Creates an empty instance of the configuration properties instance. Where the public create methods may consult a cache, this method is required to create a new instance.

Specified by:
createNewConfiguration in class AbstractConfigurationPropertiesFactory<ConfigurationPropertiesManagement>
Parameters:
key - the key to the instance.
Returns:
the instance. Never null.
Throws:
NullPointerException - if key is null.
ConfigurationException - if the configuration cannot be created.

getArtifactRef

@CheckForNull
public 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.

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class AbstractConfigurationPropertiesFactory<ConfigurationPropertiesManagement>
Returns:
the string representation of the object.


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