de.smartics.properties.impl.config.classpath
Class ClasspathConfigurationPropertiesFactory

Package class diagram package ClasspathConfigurationPropertiesFactory
java.lang.Object
  extended by de.smartics.properties.spi.config.support.AbstractConfigurationPropertiesFactory<ClasspathConfigurationProperties>
      extended by de.smartics.properties.impl.config.classpath.ClasspathConfigurationPropertiesFactory
All Implemented Interfaces:
ConfigurationPropertiesFactory, ConfigurationPropertiesManagementFactory, Serializable

@ThreadSafe
public final class ClasspathConfigurationPropertiesFactory
     
     
extends AbstractConfigurationPropertiesFactory< ClasspathConfigurationProperties>

Factory to create instances of ClasspathConfigurationProperties.

This implementation fetches the properties information from the classpath available at runtime. Therefore the environment identifier of the passed in configuration key is irrelevant to this implementation, since the environment is always the local runtime of the node it is running on. The application identifier is also artificial. Use this factory for a small application where the distinction between different environments is not useful.

See Also:
Serialized Form

Constructor Summary
ClasspathConfigurationPropertiesFactory()
          Default constructor.
 
Method Summary
 ClasspathConfigurationProperties create()
          Creates a configuration properties instance for an artificial key.
 ClasspathConfigurationProperties createManagement()
          Creates a configuration properties management instance for an artificial key.
protected  ClasspathConfigurationProperties createNewConfiguration(ConfigurationKey<?> key)
          Creates an empty instance of the configuration properties instance.
 
Methods inherited from class de.smartics.properties.spi.config.support.AbstractConfigurationPropertiesFactory
addPropertyProviders, addPropertyProviders, addRootLocations, addRootLocations, addRootUrls, create, createDefault, createDefaultManagement, createManagement, getArtifactRef, getFactoryConfiguration, getRegisteredConfigurationKeys, getRegistry, materialize, release, remove, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClasspathConfigurationPropertiesFactory

public ClasspathConfigurationPropertiesFactory()
Default constructor.

Method Detail

create

public ClasspathConfigurationProperties create()
                                        throws ConfigurationException
Creates a configuration properties instance for an artificial key.

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

createManagement

public ClasspathConfigurationProperties createManagement()
                                                  throws ConfigurationException
Creates a configuration properties management instance for an artificial key.

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

createNewConfiguration

protected ClasspathConfigurationProperties 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<ClasspathConfigurationProperties>
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.


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