Class DynamicCombinedConfiguration.CurrentConfigHolder
- java.lang.Object
-
- org.apache.commons.configuration2.DynamicCombinedConfiguration.CurrentConfigHolder
-
- Enclosing class:
- DynamicCombinedConfiguration
private static final class DynamicCombinedConfiguration.CurrentConfigHolder extends java.lang.Object
A simple data class holding information about the current configuration while an operation for a thread is processed.
-
-
Field Summary
Fields Modifier and Type Field Description private CombinedConfiguration
currentConfiguration
Stores the current configuration of the current thread.private java.lang.String
key
Stores the key of the configuration evaluated for the current thread at the beginning of an operation.private int
lockCount
A counter for reentrant locks.
-
Constructor Summary
Constructors Constructor Description CurrentConfigHolder(java.lang.String curKey)
Creates a new instance ofCurrentConfigHolder
and initializes it with the key for the current configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
decrementLockCountAndCheckRelease()
Decrements the lock counter and checks whether it has reached 0.CombinedConfiguration
getCurrentConfiguration()
Gets the current configuration.java.lang.String
getKey()
Gets the current key.void
incrementLockCount()
Increments the lock counter.void
setCurrentConfiguration(CombinedConfiguration currentConfiguration)
Sets the current configuration.
-
-
-
Field Detail
-
currentConfiguration
private CombinedConfiguration currentConfiguration
Stores the current configuration of the current thread.
-
key
private final java.lang.String key
Stores the key of the configuration evaluated for the current thread at the beginning of an operation.
-
lockCount
private int lockCount
A counter for reentrant locks.
-
-
Method Detail
-
decrementLockCountAndCheckRelease
public boolean decrementLockCountAndCheckRelease()
Decrements the lock counter and checks whether it has reached 0. In this cause, the operation is complete, and the lock can be released.- Returns:
- true if the lock count reaches 0, false otherwise
-
getCurrentConfiguration
public CombinedConfiguration getCurrentConfiguration()
Gets the current configuration.- Returns:
- the current configuration
-
getKey
public java.lang.String getKey()
Gets the current key.- Returns:
- the current key
-
incrementLockCount
public void incrementLockCount()
Increments the lock counter.
-
setCurrentConfiguration
public void setCurrentConfiguration(CombinedConfiguration currentConfiguration)
Sets the current configuration.- Parameters:
currentConfiguration
- the current configuration
-
-