Class DynamicConfigApplier

java.lang.Object
com.loomcache.server.config.DynamicConfigApplier

public class DynamicConfigApplier extends Object
Applies dynamic configuration changes to running components without requiring restart.

Built-in configuration keys:

  • cache.max-size - maximum number of entries in cache
  • cache.eviction-policy - eviction policy (LRU, LFU, FIFO)
  • cache.ttl-default-ms - default TTL for cache entries
  • network.max-connections - maximum concurrent connections
  • network.read-timeout-ms - socket read timeout
  • security.rate-limit-per-second - rate limit for requests
  • log.level - logging level (DEBUG, INFO, WARN, ERROR)

Uses pattern matching on namespace to route changes to correct handlers. Supports rollback on failure.

  • Constructor Details

    • DynamicConfigApplier

      public DynamicConfigApplier(ClusterConfigManager configManager)
      Create a new DynamicConfigApplier.
      Parameters:
      configManager - the cluster config manager
  • Method Details

    • registerHandler

      public void registerHandler(String key, DynamicConfigApplier.ConfigChangeHandler handler)
      Register a handler for a configuration key.
      Parameters:
      key - the configuration key
      handler - the handler function
    • applyChange

      public boolean applyChange(String key, @Nullable String oldValue, String newValue)
      Apply a configuration change, with automatic rollback on failure.
      Parameters:
      key - the configuration key
      oldValue - the previous value
      newValue - the new value
      Returns:
      true if applied successfully, false on failure
    • rollback

      public boolean rollback(String key)
      Rollback a configuration change.
      Parameters:
      key - the configuration key to rollback
      Returns:
      true if rollback succeeded, false otherwise
    • createApplierListener

      public ConfigChangeListener createApplierListener()
      Create a config change listener that applies changes dynamically.
      Returns:
      a ConfigChangeListener that applies changes