Class LoomJCacheConfig<K,V>

java.lang.Object
com.loomcache.server.jcache.LoomJCacheConfig<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Serializable, javax.cache.configuration.CompleteConfiguration<K,V>, javax.cache.configuration.Configuration<K,V>

public final class LoomJCacheConfig<K,V> extends Object implements javax.cache.configuration.CompleteConfiguration<K,V>
JCache-compatible configuration for a LoomCache cache instance.

Implements CompleteConfiguration so it can be passed directly to CacheManager.createCache(String, javax.cache.configuration.Configuration).

Supports standard cache settings: store-by-value vs store-by-reference, read-through/write-through caching, statistics, management, and expiry policies.

Immutable configuration built via the Builder pattern.

See Also:
  • Method Details

    • cacheName

      public String cacheName()
    • storeByValue

      public boolean storeByValue()
    • storeByReference

      public boolean storeByReference()
    • readThrough

      public boolean readThrough()
    • writeThrough

      public boolean writeThrough()
    • statisticsEnabled

      public boolean statisticsEnabled()
    • managementEnabled

      public boolean managementEnabled()
    • expiryPolicyType

      public LoomJCacheConfig.ExpiryPolicyType expiryPolicyType()
    • expiryDuration

      public Duration expiryDuration()
    • maxIdleTimeSeconds

      public int maxIdleTimeSeconds()
    • distributedEnabled

      public boolean distributedEnabled()
      Whether Raft-replicated backing storage is enabled (see JCacheDistributedMapAdapter).
    • distributedRegistry

      public @Nullable DataStructureRegistry distributedRegistry()
      Registry used to resolve the backing Raft-replicated map when distributedEnabled() is true. null otherwise.
    • getKeyType

      public Class<K> getKeyType()
      Specified by:
      getKeyType in interface javax.cache.configuration.Configuration<K,V>
    • getValueType

      public Class<V> getValueType()
      Specified by:
      getValueType in interface javax.cache.configuration.Configuration<K,V>
    • isStoreByValue

      public boolean isStoreByValue()
      Specified by:
      isStoreByValue in interface javax.cache.configuration.Configuration<K,V>
    • isReadThrough

      public boolean isReadThrough()
      Specified by:
      isReadThrough in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • isWriteThrough

      public boolean isWriteThrough()
      Specified by:
      isWriteThrough in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • isStatisticsEnabled

      public boolean isStatisticsEnabled()
      Specified by:
      isStatisticsEnabled in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • isManagementEnabled

      public boolean isManagementEnabled()
      Specified by:
      isManagementEnabled in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • getCacheEntryListenerConfigurations

      public Iterable<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> getCacheEntryListenerConfigurations()
      Specified by:
      getCacheEntryListenerConfigurations in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • getExpiryPolicyFactory

      public javax.cache.configuration.Factory<javax.cache.expiry.ExpiryPolicy> getExpiryPolicyFactory()
      Specified by:
      getExpiryPolicyFactory in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • getCacheLoaderFactory

      public @Nullable javax.cache.configuration.Factory<javax.cache.integration.CacheLoader<K,V>> getCacheLoaderFactory()
      Specified by:
      getCacheLoaderFactory in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • getCacheWriterFactory

      public @Nullable javax.cache.configuration.Factory<javax.cache.integration.CacheWriter<? super K, ? super V>> getCacheWriterFactory()
      Specified by:
      getCacheWriterFactory in interface javax.cache.configuration.CompleteConfiguration<K,V>
    • builder

      public static <K,V> LoomJCacheConfig.Builder<K,V> builder()
    • builder

      public static <K,V> LoomJCacheConfig.Builder<K,V> builder(Class<K> keyType, Class<V> valueType)