Class OracleSyncCache
java.lang.Object
io.micronaut.cache.oracle.OracleSyncCache
- All Implemented Interfaces:
Cache<OracleCacheEntryRepository>, SyncCache<OracleCacheEntryRepository>
Synchronous Oracle cache implementation.
- Since:
- 6.2.0
- Author:
- Davide Cocco
-
Constructor Summary
ConstructorsConstructorDescriptionOracleSyncCache(OracleCacheConfiguration configuration, OracleCacheEntryRepository entryRepository, OracleCacheStatsRepository statsRepository, ExecutorService executorService, OracleKeySerializer keySerializer, io.micronaut.serde.oracle.jdbc.json.OracleJdbcJsonBinaryObjectMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescription<T> @NonNull Optional<T> Resolve the given value for the given key.<T> Tget(@NonNull Object key, @NonNull io.micronaut.core.type.Argument<T> requiredType, @NonNull Supplier<T> supplier) Resolve the given value for the given key.org.reactivestreams.Publisher<CacheInfo> getName()voidinvalidate(@NonNull Object key) Invalidate the value for the given key.voidInvalidate all cached values within this cache.voidCache the specified value using the specified key.<T> @NonNull Optional<T> putIfAbsent(@NonNull Object key, @NonNull T value) Cache the specified value using the specified key if it is not already present.voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SyncCache
async, get, get, putIfAbsent
-
Constructor Details
-
OracleSyncCache
public OracleSyncCache(OracleCacheConfiguration configuration, OracleCacheEntryRepository entryRepository, OracleCacheStatsRepository statsRepository, ExecutorService executorService, OracleKeySerializer keySerializer, io.micronaut.serde.oracle.jdbc.json.OracleJdbcJsonBinaryObjectMapper jsonMapper)
-
-
Method Details
-
get
public <T> @NonNull Optional<T> get(@NonNull Object key, @NonNull io.micronaut.core.type.Argument<T> requiredType) Description copied from interface:SyncCacheResolve the given value for the given key.- Specified by:
getin interfaceSyncCache<OracleCacheEntryRepository>- Type Parameters:
T- The concrete type- Parameters:
key- The cache keyrequiredType- The required type- Returns:
- An optional containing the value if it exists and is able to be converted to the specified type
-
get
public <T> T get(@NonNull Object key, @NonNull io.micronaut.core.type.Argument<T> requiredType, @NonNull Supplier<T> supplier) Description copied from interface:SyncCacheResolve the given value for the given key. If the value is not found the specifiedSupplierwill be invoked and the return value cached.- Specified by:
getin interfaceSyncCache<OracleCacheEntryRepository>- Type Parameters:
T- The concrete type- Parameters:
key- The cache keyrequiredType- The required typesupplier- The supplier that should be invoked if the value is not found- Returns:
- An optional containing the value if it exists and is able to be converted to the specified type
-
putIfAbsent
Description copied from interface:SyncCacheCache the specified value using the specified key if it is not already present.
- Specified by:
putIfAbsentin interfaceSyncCache<OracleCacheEntryRepository>- Type Parameters:
T- The concrete type- Parameters:
key- the key with which the specified value is to be associatedvalue- the value to be associated with the specified key- Returns:
- An optional of the existing value or
Optional.empty()if the specified value parameter was cached
-
put
Description copied from interface:SyncCacheCache the specified value using the specified key.
- Specified by:
putin interfaceSyncCache<OracleCacheEntryRepository>- Parameters:
key- the key with which the specified value is to be associatedvalue- the value to be associated with the specified key
-
invalidate
Description copied from interface:SyncCacheInvalidate the value for the given key.- Specified by:
invalidatein interfaceSyncCache<OracleCacheEntryRepository>- Parameters:
key- The key to invalid
-
invalidateAll
public void invalidateAll()Description copied from interface:SyncCacheInvalidate all cached values within this cache.- Specified by:
invalidateAllin interfaceSyncCache<OracleCacheEntryRepository>
-
getName
- Specified by:
getNamein interfaceCache<OracleCacheEntryRepository>- Returns:
- The name of the cache
-
getNativeCache
- Specified by:
getNativeCachein interfaceCache<OracleCacheEntryRepository>- Returns:
- The native cache implementation
-
getExecutorService
- Specified by:
getExecutorServicein interfaceSyncCache<OracleCacheEntryRepository>- Returns:
- The executor service used to construct the default asynchronous cache.
-
getCacheInfo
- Specified by:
getCacheInfoin interfaceCache<OracleCacheEntryRepository>- Returns:
- The cache information.
-
runCleanup
public void runCleanup()
-