Interface EmbeddedCacheConfiguration

All Superinterfaces:
BasicCacheConfiguration, BasicCacheContainerConfiguration, CacheConfiguration, EmbeddedCacheContainerConfiguration
All Known Subinterfaces:
CacheRegistry.Configuration<K,V>, CacheServiceProviderRegistrar.Configuration

public interface EmbeddedCacheConfiguration extends EmbeddedCacheContainerConfiguration, BasicCacheConfiguration
Configuration associated with an embedded Infinispan cache.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    <K,V> org.infinispan.Cache<K,V>
    Returns the cache associated with this configuration.
    default org.infinispan.manager.EmbeddedCacheManager
    Returns the associated cache container.
    default <K,V> CacheEntryMutatorFactory<K,V>
    Returns the cache entry mutator associated with this configuration.
    default <K,V,O> CacheEntryMutatorFactory<K,O>
    Returns the compute-based cache entry mutator associated with this configuration.
    Returns the properties of the associated cache.
    default String
    Returns the name of the associated cache container.
    default <K,V> org.infinispan.Cache<K,V>
    Returns a cache with select-for-update semantics.
    default <K,V> org.infinispan.Cache<K,V>
    Returns a cache for use with write operations, e.g. put/compute/replace.
    default io.github.resilience4j.retry.RetryConfig
    Returns a retry configuration suitable for operations on this cache.
    default <K,V> org.infinispan.Cache<K,V>
    Returns a cache whose write operations do not trigger cache listeners.
    default Duration
    Returns the duration of time a service should wait for ongoing operations to complete prior to stopping.
    default Optional<jakarta.transaction.TransactionManager>
    If present, returns the transaction manager associated with this cache configuration.
    default <K,V> org.infinispan.Cache<K,V>
    Returns a cache with try-lock write semantic, e.g. whose write operations will return null if another transaction owns the write lock.
    default <K,V> org.infinispan.Cache<K,V>
    Returns a cache with select-for-update and try-lock semantics.
    default <K,V> org.infinispan.Cache<K,V>
    Returns a cache for use with write-only operations, e.g. put/remove where previous values are not needed.
    default boolean
    Indicates whether the associated cache is active.
    default boolean
    Indicates whether write operations should tolerate remote failures.
    of(org.infinispan.Cache<?,?> cache)
    Creates a cache configuration for the specified cache.
    of(org.infinispan.manager.EmbeddedCacheManager container, String cacheName)
    Creates a cache configuration using the specified cache of the specified manager.

    Methods inherited from interface BasicCacheConfiguration

    getBatchFactory

    Methods inherited from interface EmbeddedCacheContainerConfiguration

    getExecutor
  • Method Details

    • of

      static EmbeddedCacheConfiguration of(org.infinispan.manager.EmbeddedCacheManager container, String cacheName)
      Creates a cache configuration using the specified cache of the specified manager.
      Parameters:
      container - a cache container
      cacheName - a cache name
      Returns:
      a cache configuration
    • of

      static EmbeddedCacheConfiguration of(org.infinispan.Cache<?,?> cache)
      Creates a cache configuration for the specified cache.
      Parameters:
      cache - a cache
      Returns:
      a cache configuration
    • getCache

      <K,V> org.infinispan.Cache<K,V> getCache()
      Description copied from interface: BasicCacheConfiguration
      Returns the cache associated with this configuration.
      Specified by:
      getCache in interface BasicCacheConfiguration
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      the cache associated with this configuration.
    • getName

      default String getName()
      Description copied from interface: BasicCacheContainerConfiguration
      Returns the name of the associated cache container.
      Specified by:
      getName in interface BasicCacheConfiguration
      Specified by:
      getName in interface BasicCacheContainerConfiguration
      Specified by:
      getName in interface EmbeddedCacheContainerConfiguration
      Returns:
      the name of the associated cache container.
    • isActive

      default boolean isActive()
      Description copied from interface: CacheConfiguration
      Indicates whether the associated cache is active.
      Specified by:
      isActive in interface CacheConfiguration
      Returns:
      true, if the associated cache is active, false otherwise.
    • getCacheEntryMutatorFactory

      default <K,V> CacheEntryMutatorFactory<K,V> getCacheEntryMutatorFactory()
      Description copied from interface: BasicCacheConfiguration
      Returns the cache entry mutator associated with this configuration.
      Specified by:
      getCacheEntryMutatorFactory in interface BasicCacheConfiguration
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      the cache entry mutator associated with this configuration.
    • getCacheEntryMutatorFactory

      default <K,V,O> CacheEntryMutatorFactory<K,O> getCacheEntryMutatorFactory(Function<O, BiFunction<Object,V,V>> functionFactory)
      Description copied from interface: BasicCacheConfiguration
      Returns the compute-based cache entry mutator associated with this configuration.
      Specified by:
      getCacheEntryMutatorFactory in interface BasicCacheConfiguration
      Type Parameters:
      K - the cache key type
      V - the cache value type
      O - the operand type
      Parameters:
      functionFactory - a compute function factory
      Returns:
      the compute-based cache entry mutator associated with this configuration.
    • getTransactionManager

      default Optional<jakarta.transaction.TransactionManager> getTransactionManager()
      Description copied from interface: BasicCacheConfiguration
      If present, returns the transaction manager associated with this cache configuration.
      Specified by:
      getTransactionManager in interface BasicCacheConfiguration
      Returns:
      and optional transaction manager
    • getCacheContainer

      default org.infinispan.manager.EmbeddedCacheManager getCacheContainer()
      Description copied from interface: BasicCacheContainerConfiguration
      Returns the associated cache container.
      Specified by:
      getCacheContainer in interface BasicCacheContainerConfiguration
      Specified by:
      getCacheContainer in interface EmbeddedCacheContainerConfiguration
      Returns:
      the associated cache container.
    • getCacheProperties

      default CacheProperties getCacheProperties()
      Description copied from interface: CacheConfiguration
      Returns the properties of the associated cache.
      Specified by:
      getCacheProperties in interface CacheConfiguration
      Returns:
      the properties of the associated cache.
    • isFaultTolerant

      default boolean isFaultTolerant()
      Indicates whether write operations should tolerate remote failures.
      Returns:
      true, if a remote exception should not prevent a cache operation from succeeding, false otherwise.
    • getReadWriteCache

      default <K,V> org.infinispan.Cache<K,V> getReadWriteCache()
      Returns a cache for use with write operations, e.g. put/compute/replace.
      Specified by:
      getReadWriteCache in interface BasicCacheConfiguration
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      a cache with write semantics.
    • getReadForUpdateCache

      default <K,V> org.infinispan.Cache<K,V> getReadForUpdateCache()
      Returns a cache with select-for-update semantics.
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      a cache with select-for-update semantics.
    • getTryLockCache

      default <K,V> org.infinispan.Cache<K,V> getTryLockCache()
      Returns a cache with try-lock write semantic, e.g. whose write operations will return null if another transaction owns the write lock.
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      a cache with try-lock semantics.
    • getTryReadForUpdateCache

      default <K,V> org.infinispan.Cache<K,V> getTryReadForUpdateCache()
      Returns a cache with select-for-update and try-lock semantics.
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      a cache with try-lock and select-for-update semantics.
    • getWriteOnlyCache

      default <K,V> org.infinispan.Cache<K,V> getWriteOnlyCache()
      Returns a cache for use with write-only operations, e.g. put/remove where previous values are not needed.
      Specified by:
      getWriteOnlyCache in interface BasicCacheConfiguration
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      a cache for use with write-only operations.
    • getSilentWriteCache

      default <K,V> org.infinispan.Cache<K,V> getSilentWriteCache()
      Returns a cache whose write operations do not trigger cache listeners.
      Type Parameters:
      K - the cache key type
      V - the cache value type
      Returns:
      a cache whose write operations do not trigger cache listeners.
    • getRetryConfig

      default io.github.resilience4j.retry.RetryConfig getRetryConfig()
      Returns a retry configuration suitable for operations on this cache.
      Returns:
      a retry configuration
    • getStopTimeout

      default Duration getStopTimeout()
      Description copied from interface: BasicCacheConfiguration
      Returns the duration of time a service should wait for ongoing operations to complete prior to stopping.
      Specified by:
      getStopTimeout in interface BasicCacheConfiguration
      Returns:
      the duration of time a service should wait for ongoing operations to complete prior to stopping.