Class DynamicCombinedConfiguration.CurrentConfigHolder

java.lang.Object
org.apache.commons.configuration2.DynamicCombinedConfiguration.CurrentConfigHolder
Enclosing class:
DynamicCombinedConfiguration

private static class DynamicCombinedConfiguration.CurrentConfigHolder extends Object
A simple data class holding information about the current configuration while an operation for a thread is processed.
  • Field Details

    • currentConfiguration

      private CombinedConfiguration currentConfiguration
      Stores the current configuration of the current thread.
    • key

      private final 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.
  • Constructor Details

    • CurrentConfigHolder

      public CurrentConfigHolder(String curKey)
      Creates a new instance of CurrentConfigHolder and initializes it with the key for the current configuration.
      Parameters:
      curKey - the current key
  • Method Details

    • getCurrentConfiguration

      public CombinedConfiguration getCurrentConfiguration()
      Gets the current configuration.
      Returns:
      the current configuration
    • setCurrentConfiguration

      public void setCurrentConfiguration(CombinedConfiguration currentConfiguration)
      Sets the current configuration.
      Parameters:
      currentConfiguration - the current configuration
    • getKey

      public String getKey()
      Gets the current key.
      Returns:
      the current key
    • incrementLockCount

      public void incrementLockCount()
      Increments the lock counter.
    • 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