All Downloads are FREE. Search and download functionalities are using the official Maven repository.

n-manes.caffeine.jcache.3.1.5.source-code.reference.conf Maven / Gradle / Ivy

# This is the reference configuration file that contains all the default settings.
# Make your edits/overrides in your application.conf.

caffeine.jcache {

  # A named cache is configured by nesting a new definition under the caffeine.jcache namespace. The
  # per-cache configuration is overlaid on top of the default configuration.
  default {

    # The required type of the keys
    key-type = java.lang.Object
    # The required type of the values
    value-type = java.lang.Object

    # The strategy for copying the cache entry for value-based storage
    store-by-value {

      # If enabled, the entry is copied when crossing the API boundary
      enabled = false

      # It is highly recommended that the default strategy be replaced with a higher performance
      # alternative (see https://github.com/eishay/jvm-serializers/wiki).
      strategy = "com.github.benmanes.caffeine.jcache.copy.JavaSerializationCopier"
    }

    # The executor class to use when performing maintenance and asynchronous operations. Defaults to
    # using ForkJoinPool.commonPool() if not set.
    executor = null

    # The scheduler class to use when scheduling routine maintenance based on an expiration events.
    # Defaults to Scheduler.disabledScheduler() if not set.
    scheduler = null

    # The list of configuration paths to the listeners that consume this cache's events
    listeners = []

    read-through {
      # If enabled, the entry is loaded automatically on a cache miss
      enabled = false

      # The CacheLoader class for loading entries
      loader = null
    }

    write-through {
      # If enabled, the entry is written to the resource before the cache is updated
      enabled = false

      # The CacheWriter class for writing entries
      writer = null
    }

    # The monitoring configuration
    monitoring {
      # If Caffeine's statistics should be recorded (manually externalized via Cache#unwrap)
      native-statistics = false

      # If JCache statistics should be recorded and externalized via JMX
      statistics = false

      # If the configuration should be externalized via JMX
      management = false
    }

    # The eviction policy for automatically removing entries from the cache
    policy {
      # The expiration threshold before lazily evicting an entry. This single threshold is reset on
      # every operation where a duration is specified. As expected by the specification, if an entry
      # expires but is not accessed and no resource constraints force eviction, then the expired
      # entry remains in place.
      lazy-expiration {
        # The duration before a newly created entry is considered expired. If set to 0 then the
        # entry is considered to be already expired and will not be added to the cache. May be
        # a time duration or "eternal" to indicate no expiration.
        creation = "eternal"

        # The duration before a updated entry is considered expired. If set to 0 then the entry is
        # considered immediately expired. May be a time duration, null to indicate no change, or
        # "eternal" to indicate no expiration.
        update = "eternal"

        # The duration before a read of an entry is considered expired. If set to 0 then the entry
        # is considered immediately expired. May be a time duration, null to indicate no change, or
        # "eternal" to indicate no expiration.
        access = "eternal"
      }

      # The expiration thresholds before eagerly evicting an entry. These settings correspond to the
      # expiration supported natively by Caffeine where expired entries are collected during
      # maintenance operations.
      eager-expiration {
        # Specifies that each entry should be automatically removed from the cache once a fixed
        # duration has elapsed after the entry's creation, or the most recent replacement of its
        # value. This setting cannot be combined with the variable configuration.
        after-write = null

        # Specifies that each entry should be automatically removed from the cache once a fixed
        # duration has elapsed after the entry's creation, the most recent replacement of its value,
        # or its last read. Access time is reset by all cache read and write operation. This setting
        # cannot be combined with the variable configuration.
        after-access = null

        # The expiry class to use when calculating the expiration time of cache entries. This
        # setting cannot be combined with after-write or after-access configurations.
        variable = null
      }

      # The threshold before an entry is eligible to be automatically refreshed when the first stale
      # request for an entry occurs. This setting is honored only when combined with the
      # read-through configuration.
      refresh {
        # Specifies that active entries are eligible for automatic refresh once a fixed duration has
        # elapsed after the entry's creation or the most recent replacement of its value.
        after-write = null
      }

      # The maximum bounding of the cache based upon its logical size
      maximum {
        # The maximum number of entries that can be held by the cache. This setting cannot be
        # combined with the weight configuration.
        size = null

        # The maximum total weight of entries the cache may contain (requires a weigher). This
        # setting cannot be combined with the size configuration.
        weight = null

        # The weigher class to use when calculating the weight of cache entries
        weigher = null
      }
    }
  }

  # A catalog of cache listeners; optionally defined in any namespace as referenced by path
  listeners {

    # An example definition of a listener
    example {
      # The CacheEntryListener class
      class = null

      # The CacheEntryEventFilter class that should be applied prior to notifying the listener
      filter = null

      # If the thread that created the event should block until the listener has completed
      synchronous = false

      # If the old value should be provided
      old-value-required = false
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy