|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.impl.config.domain.key.envapp.EnvAppConfigurationKeyHelper
public final class EnvAppConfigurationKeyHelper
Helper to construct configuration keys by analyzing the runtime environment.
Field Summary | |
---|---|
static String |
SYSTEM_PROPERTY_ENVIRONMENT_NAME The name of the system property that stores the name of the environment. |
static String |
SYSTEM_PROPERTY_ENVIRONMENT_NODE The name of the system property that stores the node name of the environment. |
Constructor Summary | |
---|---|
EnvAppConfigurationKeyHelper() Convenience constructor preferring manifest information from EARs. |
|
EnvAppConfigurationKeyHelper(boolean preferEarManifest) Default constructor. |
Method Summary | |
---|---|
EnvAppConfigurationKey |
load(ApplicationId applicationId) Loads the configuration key using the given applicationId and determines the environmentId through system properties or defaults (null for the environment and hostname for the node). |
EnvAppConfigurationKey |
load(Class<?> locator) Loads the application identifier from the manifest file pointed at by the given locator class. |
EnvAppConfigurationKey |
load(EnvironmentId environmentId, Class<?> locator) Loads the application identifier from the manifest file pointed at by the given locator class. |
EnvAppConfigurationKey |
load(String environmentName, Class<?> locator) Loads the application identifier from the manifest file pointed at by the given locator class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SYSTEM_PROPERTY_ENVIRONMENT_NAME
The value of this constant is "properties.environment.name".
"properties.environment.name"
public static final String SYSTEM_PROPERTY_ENVIRONMENT_NODE
The value of this constant is "properties.environment.node".
"properties.environment.node"
Constructor Detail |
---|
public EnvAppConfigurationKeyHelper()
public EnvAppConfigurationKeyHelper(boolean preferEarManifest)
preferEarManifest
- the flag to signal that the manifest of a EAR file (with the extension
ear
) is preferred if present.
Method Detail |
---|
public EnvAppConfigurationKey load(Class<?> locator) throws IllegalStateException
locator
class.
load
in interface
ConfigurationKeyHelper
locator
- the class to locate the manifest file to load. It is the manifest file of the archive this class is part of.
IllegalStateException
- if the application identifier cannot be read from the manifest.
load(EnvironmentId, Class)
public EnvAppConfigurationKey load(String environmentName, Class<?> locator) throws IllegalStateException
locator
class.
load
in interface
ConfigurationKeyHelper
environmentName
- the name of the environment of use. May be
null
if the value of the system property
SYSTEM_PROPERTY_ENVIRONMENT_NAME
should be used (along with the node name defined by
SYSTEM_PROPERTY_ENVIRONMENT_NODE
). If not specified, the name of the host of this runtime is determined.
locator
- the class to locate the manifest file to load. It is the manifest file of the archive this class is part of.
IllegalStateException
- if the application identifier cannot be read from the manifest.
load(EnvironmentId, Class)
public EnvAppConfigurationKey load(EnvironmentId environmentId, Class<?> locator) throws IllegalStateException
locator
class.
load
in interface
ConfigurationKeyHelper
environmentId
- the environment part of the configuration key to construct.
locator
- the class to locate the manifest file to load. It is the manifest file of the archive this class is part of.
IllegalStateException
- if the application identifier cannot be read from the manifest.
load(Class)
,
load(String, Class)
public EnvAppConfigurationKey load(ApplicationId applicationId)
load
in interface
ConfigurationKeyHelper
applicationId
- the application part of the configuration key to construct.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |