de.smartics.properties.api.config.domain
Class ConfigControl

Package class diagram package ConfigControl
java.lang.Object
  extended by de.smartics.properties.api.config.domain.ConfigControl

public final class ConfigControl
     
     
extends Object

Controls how configurations are configured within a given thread.

The control instance is stored in the current thread as a thread-local variable. Please make sure to reset the value after use in a finally block.


Constructor Summary
ConfigControl(boolean adminMode)
          Default constructor.
 
Method Summary
static void cleanUp()
          Removes the thread-local configuration control.
static ConfigControl get()
          Provides access to the thread-local context.
 boolean isAdminMode()
          Returns the switch to turn the management configuration into an administration configuration.
 void setAdminMode(boolean adminMode)
          Sets the switch to turn the management configuration into an administration configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigControl

public ConfigControl(boolean adminMode)
Default constructor.

Parameters:
adminMode - the switch to turn the management configuration into an administration configuration.
Method Detail

isAdminMode

public boolean isAdminMode()
Returns the switch to turn the management configuration into an administration configuration. In administration mode the configuration allows to deal with properties not allowed in management mode. E.g. read-only properties are not allowed to be changed in management mode, but are allowed to be changed in administration mode.

Returns:
the switch to turn the management configuration into an administration configuration.

setAdminMode

public void setAdminMode(boolean adminMode)
Sets the switch to turn the management configuration into an administration configuration. In administration mode the configuration allows to deal with properties not allowed in management mode. E.g. read-only properties are not allowed to be changed in management mode, but are allowed to be changed in administration mode.

Parameters:
adminMode - the switch to turn the management configuration into an administration configuration.

get

public static ConfigControl get()
Provides access to the thread-local context.

Returns:
the configuration control in the thread-local context.

cleanUp

public static void cleanUp()
Removes the thread-local configuration control.



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