Class 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 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.
    • Constructor Detail

      • CurrentConfigHolder

        public CurrentConfigHolder​(java.lang.String curKey)
        Creates a new instance of CurrentConfigHolder and initializes it with the key for the current configuration.
        Parameters:
        curKey - the current key
    • 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