Interface AsyncNamedCache<K,V>

Type Parameters:
K - the type of the cache entry keys
V - the type of the cache entry values
All Superinterfaces:
AsyncNamedMap<K,V>

public interface AsyncNamedCache<K,V> extends AsyncNamedMap<K,V>
Asynchronous NamedCache.
Since:
12.2.1
Author:
as 2015.01.17
  • Method Details

    • getNamedCache

      NamedCache<K,V> getNamedCache()
      Return the NamedCache instance this AsyncNamedCache is based on.
      Returns:
      the NamedCache instance this AsyncNamedCache is based on
    • put

      default CompletableFuture<Void> put(K key, V value, long cMillis)
      Associates the specified value with the specified key in this cache. If the cache previously contained a mapping for this key, the old value is replaced. This variation of the AsyncNamedMap.put(Object oKey, Object oValue) method allows the caller to specify an expiry (or "time to live") for the cache entry.
      Parameters:
      key - key with which the specified value is to be associated
      value - value to be associated with the specified key
      cMillis - the number of milliseconds until the cache entry will expire, also referred to as the entry's "time to live"; pass CacheMap.EXPIRY_DEFAULT to use the cache's default time-to-live setting; pass CacheMap.EXPIRY_NEVER to indicate that the cache entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()
      Returns:
      a CompletableFuture
    • putAll

      default CompletableFuture<Void> putAll(Map<? extends K,? extends V> map, long cMillis)
      Copies all the mappings from the specified map to this map with the specified expiry delay.

      NOTE: This method was introduced in a patch to Coherence. All the cluster members must be running with a compatible version (the patch or higher) for this method to work. See DistributedAsyncNamedCache.IS_BINARY_PROCESSOR_COMPATIBLE

      Parameters:
      map - mappings to be added to this map
      cMillis - the number of milliseconds until the cache entry will expire, also referred to as the entry's "time to live"; pass CacheMap.EXPIRY_DEFAULT to use the cache's default time-to-live setting; pass CacheMap.EXPIRY_NEVER to indicate that the cache entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()
      Returns:
      a CompletableFuture