de.smartics.properties.impl.config.properties
Class PropertiesConfigurationPropertiesFactory

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

@ThreadSafe
public final class PropertiesConfigurationPropertiesFactory
     
     
extends AbstractConfigurationPropertiesFactory< PropertiesConfigurationProperties>

Factory to create instances of PropertiesConfigurationProperties.

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.

See Also:
Serialized Form

Constructor Summary
PropertiesConfigurationPropertiesFactory()
          Default constructor.
 
Method Summary
 PropertiesConfigurationProperties create(ApplicationId applicationId)
          Creates a configuration properties instance for an artificial environment.
 PropertiesConfigurationProperties createManagement(ApplicationId applicationId)
          Creates a configuration properties management instance for an artificial environment.
protected  PropertiesConfigurationProperties 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

PropertiesConfigurationPropertiesFactory

public PropertiesConfigurationPropertiesFactory()
Default constructor.

Method Detail

create

public PropertiesConfigurationProperties create(ApplicationId applicationId)
                                         throws NullPointerException,
                                                ConfigurationException
Creates a configuration properties instance for an artificial environment.

Parameters:
applicationId - the identifier of the application whose properties are to be created.
Returns:
the requested configuration properties. Never null.
Throws:
NullPointerException - if applicationId is null.
ConfigurationException - on any problem loading the configuration properties.

createManagement

public PropertiesConfigurationProperties createManagement(ApplicationId applicationId)
                                                   throws NullPointerException,
                                                          ConfigurationException
Creates a configuration properties management instance for an artificial environment.

Parameters:
applicationId - the identifier of the application whose properties are to be created.
Returns:
the requested configuration properties. Never null.
Throws:
NullPointerException - if applicationId is null.
ConfigurationException - on any problem loading the configuration properties.

createNewConfiguration

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