Interface NamedMap<K,​V>

    • Method Detail

      • getName

        default String getName()
        Description copied from interface: NamedCollection
        Obtain the name of this NamedCollection.
        Specified by:
        getName in interface NamedCollection
        the name of this NamedCollection
      • getAll

        Map<K,​V> getAll​(Collection<? extends K> colKeys)
        Get all the specified keys, if they are in the map. For each key that is in the map, that key and its corresponding value will be placed in the map that is returned by this method. The absence of a key in the returned map indicates that it was not in the map, which may imply (for maps that can load behind the scenes) that the requested data could not be loaded.

        The result of this method is defined to be semantically the same as the following implementation, without regards to threading issues:

         Map map = new AnyMap(); // could be a HashMap (but does not have to)
         for (Iterator iter = colKeys.iterator(); iter.hasNext(); )
             Object oKey =;
             Object oVal = get(oKey);
             if (oVal != null || containsKey(oKey))
                 map.put(oKey, oVal);
         return map;

        colKeys - a collection of keys that may be in the named map
        a Map of keys to values for the specified keys passed in colKeys
      • clear

        void clear()
        Removes all mappings from this map.

        Note: invoking the clear() operation against a distributed map can be both a memory and CPU intensive task and therefore is generally not recommended. Either truncate() or NamedCollection.destroy() operations may be suitable alternatives.

        Specified by:
        clear in interface ConcurrentMap<K,​V>
        Specified by:
        clear in interface Map<K,​V>
      • truncate

        default void truncate()
        Removes all mappings from this map.

        Note: the removal of entries caused by this truncate operation will not be observable. This includes any registered listeners, triggers, or interceptors. However, a CacheLifecycleEvent is raised to notify subscribers of the execution of this operation.

        UnsupportedOperationException - if the server does not support the truncate operation
      • async

        default AsyncNamedMap<K,​V> async​(AsyncNamedMap.Option... options)
        Return an asynchronous wrapper for this NamedMap.

        By default, the order of execution of asynchronous operation invoked on the returned AsyncNamedMap will be preserved by ensuring that all operations invoked from the same client thread are executed on the server sequentially, using the same unit-of-order. This tends to provide the best performance for fast, non-blocking operations.

        However, when invoking CPU-intensive or blocking operations, such as read- or write-through operations that access remote database or web service, for example, it may be very beneficial to allow the server to parallelize execution by passing AsyncNamedMap.OrderBy.none() configuration option to this method. Note, that in that case there are no guarantees for the order of execution.

        options - the configuration options
        asynchronous wrapper for this NamedMap
      • view

        default <V_FRONT> MapViewBuilder<K,​V,​V_FRONT> view()
        Construct a view of this NamedMap.
        Type Parameters:
        V_FRONT - the type of the entry values in this view, which will be the same as V_BACK, unless a transformer is specified when creating this view
        a local view for this NamedMap
        See Also:
      • isReady

        default boolean isReady()
        Returns whether this NamedMap is ready to be used.

        An example of when this method would return false would be where a partitioned cache service that owns this cache has no store-enabled members.
        return true if the NamedMap may be used otherwise returns false.
      • isActive

        boolean isActive()
        Returns true if this map is not released or destroyed. In other words, calling isActive() is equivalent to calling !cache.isReleased() && !cache.isDestroyed().
        Specified by:
        isActive in interface Releasable
        true if the cache is active, otherwise false