de.smartics.properties.impl.config.domain.key.rtaware
Class TenantUserConfigurationKeyHelper

Package class diagram package TenantUserConfigurationKeyHelper
java.lang.Object
  extended by de.smartics.properties.impl.config.domain.key.rtaware.TenantUserConfigurationKeyHelper
All Implemented Interfaces:
ConfigurationKeyHelper, Serializable

public final class TenantUserConfigurationKeyHelper
     
     
extends Object
implements ConfigurationKeyHelper

Helper to construct configuration keys by analyzing the runtime environment.

See Also:
Serialized Form

Constructor Summary
TenantUserConfigurationKeyHelper()
          Convenience constructor preferring manifest information from EARs.
TenantUserConfigurationKeyHelper(boolean preferEarManifest)
          Default constructor.
 
Method Summary
 TenantUserConfigurationKey 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).
 TenantUserConfigurationKey load(Class<?> locator)
          Loads the application identifier from the manifest file pointed at by the given locator class.
 TenantUserConfigurationKey load(EnvironmentId environmentId, Class<?> locator)
          Loads the application identifier from the manifest file pointed at by the given locator class.
 TenantUserConfigurationKey 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
 

Constructor Detail

TenantUserConfigurationKeyHelper

public TenantUserConfigurationKeyHelper()
Convenience constructor preferring manifest information from EARs.


TenantUserConfigurationKeyHelper

public TenantUserConfigurationKeyHelper(boolean preferEarManifest)
Default constructor.

Parameters:
preferEarManifest - the flag to signal that the manifest of a EAR file (with the extension ear) is preferred if present.
Method Detail

load

public TenantUserConfigurationKey load(Class<?> locator)
                                throws IllegalStateException
Loads the application identifier from the manifest file pointed at by the given locator class.

Specified by:
load in interface ConfigurationKeyHelper
Parameters:
locator - the class to locate the manifest file to load. It is the manifest file of the archive this class is part of.
Returns:
the application identifier.
Throws:
IllegalStateException - if the application identifier cannot be read from the manifest.
See Also:
load(EnvironmentId, Class)

load

public TenantUserConfigurationKey load(String environmentName,
                                       Class<?> locator)
                                throws IllegalStateException
Loads the application identifier from the manifest file pointed at by the given locator class.

Specified by:
load in interface ConfigurationKeyHelper
Parameters:
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.
Returns:
the application identifier.
Throws:
IllegalStateException - if the application identifier cannot be read from the manifest.
See Also:
load(EnvironmentId, Class)

load

public TenantUserConfigurationKey load(EnvironmentId environmentId,
                                       Class<?> locator)
                                throws IllegalStateException
Loads the application identifier from the manifest file pointed at by the given locator class.

Specified by:
load in interface ConfigurationKeyHelper
Parameters:
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.
Returns:
the application identifier.
Throws:
IllegalStateException - if the application identifier cannot be read from the manifest.
See Also:
load(Class), load(String, Class)

load

public TenantUserConfigurationKey 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).

Specified by:
load in interface ConfigurationKeyHelper
Parameters:
applicationId - the application part of the configuration key to construct.
Returns:
the configuration key.


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