de.smartics.properties.core.services
Class ThreadLocalAdminRuntime

Package class diagram package ThreadLocalAdminRuntime
java.lang.Object
  extended by de.smartics.properties.core.services.ThreadLocalAdminRuntime
All Implemented Interfaces:
AdminRuntime

public final class ThreadLocalAdminRuntime
     
     
extends Object
implements AdminRuntime

Provides means to change the default configuration name. Usually the extension configuration to use is determined by boot properties found on the classpath. This is correct for applications that only use one configuration. This is not true for administration applications that switch their configurations at runtime.

Switching is done by adding the configuration name to lookup to the thread-local context. This implementation is an easy to use wrapper.


Constructor Summary
ThreadLocalAdminRuntime()
          Default constructor.
 
Method Summary
 String getConfigurationName()
          Returns the name of the selected configuration.
static AdminRuntime getInstance()
          Returns the thread-locally stored instance.
static void remove()
          Delegates to ThreadLocal.remove().
static void setConfigurationName(String configurationName)
          Sets the name of the selected configuration.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadLocalAdminRuntime

public ThreadLocalAdminRuntime()
Default constructor.

Method Detail

getConfigurationName

public String getConfigurationName()
Description copied from interface: AdminRuntime
Returns the name of the selected configuration.

Specified by:
getConfigurationName in interface AdminRuntime
Returns:
the name of the selected configuration. May be null, if no configuration is selected. In this case the configuration name found in the boot properties is used.

setConfigurationName

public static void setConfigurationName(String configurationName)
Sets the name of the selected configuration. May be null, if no configuration is selected. In this case the configuration name found in the boot properties is used.

Parameters:
configurationName - the name of the selected configuration.

getInstance

public static AdminRuntime getInstance()
Returns the thread-locally stored instance.

Returns:
the thread-locally stored instance.

remove

public static void remove()
Delegates to ThreadLocal.remove().


toString

public String toString()
Overrides:
toString in class Object


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