Class InvalidatedNearRemoteCache<K,​V>

  • Type Parameters:
    K -
    V -
    All Implemented Interfaces:
    ConcurrentMap<K,​V>, Map<K,​V>, RemoteCache<K,​V>, org.infinispan.commons.api.AsyncCache<K,​V>, org.infinispan.commons.api.BasicCache<K,​V>, org.infinispan.commons.api.Lifecycle, org.infinispan.commons.api.TransactionalCache

    public class InvalidatedNearRemoteCache<K,​V>
    extends RemoteCacheImpl<K,​V>
    Near RemoteCache implementation enabling
    • Method Detail

      • getAsync

        public CompletableFuture<V> getAsync​(Object key)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of Map.get(Object) that allows user code to retrieve the value associated with a key at a later stage, hence allowing multiple parallel get requests to be sent. Normally, when this method detects that the value is likely to be retrieved from from a remote entity, it will span a different thread in order to allow the asynchronous get call to return immediately. If the call will definitely resolve locally, for example when the cache is configured with LOCAL mode and no stores are configured, the get asynchronous call will act sequentially and will have no different to Map.get(Object).
        Specified by:
        getAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Overrides:
        getAsync in class RemoteCacheImpl<K,​V>
        Parameters:
        key - key to retrieve
        Returns:
        a future that can be used to retrieve value associated with the key when this is available. The actual value returned by the future follows the same rules as Map.get(Object)
      • putAsync

        public CompletableFuture<V> putAsync​(K key,
                                             V value,
                                             long lifespan,
                                             TimeUnit lifespanUnit,
                                             long maxIdleTime,
                                             TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.put(Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        putAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Overrides:
        putAsync in class RemoteCacheImpl<K,​V>
        Parameters:
        key - key to use
        value - value to store
        lifespan - lifespan of entry
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        a future containing the old value replaced
      • replaceAsync

        public CompletableFuture<V> replaceAsync​(K key,
                                                 V value,
                                                 long lifespan,
                                                 TimeUnit lifespanUnit,
                                                 long maxIdleTime,
                                                 TimeUnit maxIdleTimeUnit)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.replace(Object, Object, long, TimeUnit, long, TimeUnit). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Overrides:
        replaceAsync in class RemoteCacheImpl<K,​V>
        Parameters:
        key - key to remove
        value - value to store
        lifespan - lifespan of entry
        lifespanUnit - time unit for lifespan
        maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
        maxIdleTimeUnit - time unit for max idle time
        Returns:
        a future containing the previous value overwritten
      • removeAsync

        public CompletableFuture<V> removeAsync​(Object key)
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of BasicCache.remove(Object). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        removeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Overrides:
        removeAsync in class RemoteCacheImpl<K,​V>
        Parameters:
        key - key to remove
        Returns:
        a future containing the value removed
      • clearAsync

        public CompletableFuture<Void> clearAsync()
        Description copied from interface: org.infinispan.commons.api.AsyncCache
        Asynchronous version of Map.clear(). This method does not block on remote calls, even if your cache mode is synchronous.
        Specified by:
        clearAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Overrides:
        clearAsync in class RemoteCacheImpl<K,​V>
        Returns:
        a future containing a void return type
      • start

        public void start()
        Description copied from interface: org.infinispan.commons.api.Lifecycle
        Invoked on component start
        Specified by:
        start in interface org.infinispan.commons.api.Lifecycle
        Overrides:
        start in class RemoteCacheImpl<K,​V>
      • stop

        public void stop()
        Description copied from interface: org.infinispan.commons.api.Lifecycle
        Invoked on component stop
        Specified by:
        stop in interface org.infinispan.commons.api.Lifecycle
        Overrides:
        stop in class RemoteCacheImpl<K,​V>