de.smartics.properties.api.core.config
Class BootPropertiesProvider

Package class diagram package BootPropertiesProvider
java.lang.Object
  extended by de.smartics.properties.api.core.config.BootPropertiesProvider
All Implemented Interfaces:
Serializable

public final class BootPropertiesProvider
     
     
extends Object
implements Serializable

Helper to determine the JNDI name of the configuration to select from the boot.properties.

The boot properties configuration is a concept of the configuration library. Unfortunately this configuration is also used to configure parts in the core library. Therefore we have to peek into this configuration from here.

Implementation Notes:
We access properties defined in BootProperties.
See Also:
Serialized Form

Field Summary
static String CONFIGURATION_NAME_KEY
          The key to use for looking up the configuration name within the JNDI configuration extension in the boot.properties file.
 
Method Summary
static BootPropertiesProvider createFromClasspath()
          Factory method that runs the lookup process of boot.properties in the classpath.
static BootPropertiesProvider createFromName(String configurationName)
          Creates an instance with the given JNDI name property.
 String getConfigurationName()
          Returns the name stored in the boot.
static BootPropertiesProvider shareFromClasspath()
          Default construction that runs the lookup process of boot.properties in the classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_NAME_KEY

public static final String CONFIGURATION_NAME_KEY
The key to use for looking up the configuration name within the JNDI configuration extension in the boot.properties file.

The value of this constant is "smartics.properties.bootConfigurationName".

Constant Field Value:
"smartics.properties.bootConfigurationName"
Method Detail

shareFromClasspath

public static BootPropertiesProvider shareFromClasspath()
                                                 throws IOException
Default construction that runs the lookup process of boot.properties in the classpath.

If the boot properties have already been set, the value is not read again. And the cached value is returned.

Returns:
the instance that contains the relevant boot properties.
Throws:
IOException - on any problem loading the configuration name.

createFromName

public static BootPropertiesProvider createFromName(String configurationName)
Creates an instance with the given JNDI name property.

Parameters:
configurationName - the name to set.
Returns:
an instance containing the name.

createFromClasspath

public static BootPropertiesProvider createFromClasspath()
                                                  throws IOException
Factory method that runs the lookup process of boot.properties in the classpath. on each call, the properties are read from the classpath.

Returns:
the instance that contains the relevant boot properties.
Throws:
IOException - on any problem loading the configuration name.

getConfigurationName

public String getConfigurationName()
Returns the name stored in the boot. properties to lookup the smartics extension configuration.

Returns:
the name stored in the boot.properties to lookup the extension configuration.


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