Class HazelcastSyncCache

java.lang.Object
io.micronaut.cache.AbstractMapBasedSyncCache<com.hazelcast.map.IMap<Object,Object>>
io.micronaut.cache.hazelcast.HazelcastSyncCache
All Implemented Interfaces:
Cache<com.hazelcast.map.IMap<Object,Object>>, SyncCache<com.hazelcast.map.IMap<Object,Object>>

public class HazelcastSyncCache extends AbstractMapBasedSyncCache<com.hazelcast.map.IMap<Object,Object>>
A SyncCache implementation based on Hazelcast.
Since:
1.0.0
Author:
Nirav Assar
  • Constructor Details

    • HazelcastSyncCache

      public HazelcastSyncCache(io.micronaut.core.convert.ConversionService conversionService, com.hazelcast.map.IMap<Object,Object> nativeCache, ExecutorService executorService)
      Parameters:
      conversionService - the conversion service
      nativeCache - the native cache
      executorService - managers the pool of executors
  • Method Details

    • put

      public void put(@NonNull @NonNull Object key, @NonNull @NonNull Object value)
      Description copied from interface: SyncCache

      Cache the specified value using the specified key.

      Specified by:
      put in interface SyncCache<com.hazelcast.map.IMap<Object,Object>>
      Overrides:
      put in class AbstractMapBasedSyncCache<com.hazelcast.map.IMap<Object,Object>>
      Parameters:
      key - the key with which the specified value is to be associated
      value - the value to be associated with the specified key
    • getName

      public String getName()
      Specified by:
      getName in interface Cache<com.hazelcast.map.IMap<Object,Object>>
      Specified by:
      getName in class AbstractMapBasedSyncCache<com.hazelcast.map.IMap<Object,Object>>
      Returns:
      The name of the cache
    • async

      public AsyncCache<com.hazelcast.map.IMap<Object,Object>> async()
      Description copied from interface: SyncCache

      This method returns an async version of this cache interface implementation.

      The default behaviour will execute the operations in the same thread if null is returned from SyncCache.getExecutorService(). If an executor service is returned, the operations will be offloaded to the provided executor service.

      Returns:
      The AsyncCache implementation for this cache