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 TypeMethodDescription<K,V> org.infinispan.Cache <K, V> getCache()Returns the cache associated with this configuration.default org.infinispan.manager.EmbeddedCacheManagerReturns 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> getCacheEntryMutatorFactory(Function<O, BiFunction<Object, V, V>> functionFactory) Returns the compute-based cache entry mutator associated with this configuration.default CachePropertiesReturns the properties of the associated cache.default StringgetName()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.RetryConfigReturns 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 DurationReturns 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 booleanisActive()Indicates whether the associated cache is active.default booleanIndicates whether write operations should tolerate remote failures.static EmbeddedCacheConfigurationof(org.infinispan.Cache<?, ?> cache) Creates a cache configuration for the specified cache.static EmbeddedCacheConfigurationCreates a cache configuration using the specified cache of the specified manager.Methods inherited from interface BasicCacheConfiguration
getBatchFactoryMethods 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 containercacheName- a cache name- Returns:
- a cache configuration
-
of
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:BasicCacheConfigurationReturns the cache associated with this configuration.- Specified by:
getCachein interfaceBasicCacheConfiguration- Type Parameters:
K- the cache key typeV- the cache value type- Returns:
- the cache associated with this configuration.
-
getName
Description copied from interface:BasicCacheContainerConfigurationReturns the name of the associated cache container.- Specified by:
getNamein interfaceBasicCacheConfiguration- Specified by:
getNamein interfaceBasicCacheContainerConfiguration- Specified by:
getNamein interfaceEmbeddedCacheContainerConfiguration- Returns:
- the name of the associated cache container.
-
isActive
default boolean isActive()Description copied from interface:CacheConfigurationIndicates whether the associated cache is active.- Specified by:
isActivein interfaceCacheConfiguration- Returns:
- true, if the associated cache is active, false otherwise.
-
getCacheEntryMutatorFactory
Description copied from interface:BasicCacheConfigurationReturns the cache entry mutator associated with this configuration.- Specified by:
getCacheEntryMutatorFactoryin interfaceBasicCacheConfiguration- Type Parameters:
K- the cache key typeV- the cache value type- Returns:
- the cache entry mutator associated with this configuration.
-
getCacheEntryMutatorFactory
default <K,V, CacheEntryMutatorFactory<K,O> O> getCacheEntryMutatorFactory(Function<O, BiFunction<Object, V, V>> functionFactory) Description copied from interface:BasicCacheConfigurationReturns the compute-based cache entry mutator associated with this configuration.- Specified by:
getCacheEntryMutatorFactoryin interfaceBasicCacheConfiguration- Type Parameters:
K- the cache key typeV- the cache value typeO- the operand type- Parameters:
functionFactory- a compute function factory- Returns:
- the compute-based cache entry mutator associated with this configuration.
-
getTransactionManager
Description copied from interface:BasicCacheConfigurationIf present, returns the transaction manager associated with this cache configuration.- Specified by:
getTransactionManagerin interfaceBasicCacheConfiguration- Returns:
- and optional transaction manager
-
getCacheContainer
default org.infinispan.manager.EmbeddedCacheManager getCacheContainer()Description copied from interface:BasicCacheContainerConfigurationReturns the associated cache container.- Specified by:
getCacheContainerin interfaceBasicCacheContainerConfiguration- Specified by:
getCacheContainerin interfaceEmbeddedCacheContainerConfiguration- Returns:
- the associated cache container.
-
getCacheProperties
Description copied from interface:CacheConfigurationReturns the properties of the associated cache.- Specified by:
getCachePropertiesin interfaceCacheConfiguration- 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:
getReadWriteCachein interfaceBasicCacheConfiguration- Type Parameters:
K- the cache key typeV- 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 typeV- 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 typeV- 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 typeV- 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:
getWriteOnlyCachein interfaceBasicCacheConfiguration- Type Parameters:
K- the cache key typeV- 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 typeV- 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
Description copied from interface:BasicCacheConfigurationReturns the duration of time a service should wait for ongoing operations to complete prior to stopping.- Specified by:
getStopTimeoutin interfaceBasicCacheConfiguration- Returns:
- the duration of time a service should wait for ongoing operations to complete prior to stopping.
-