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
        Returns:
        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 = iter.next();
             Object oVal = get(oKey);
             if (oVal != null || containsKey(oKey))
                 {
                 map.put(oKey, oVal);
                 }
             }
         return map;
         
        Parameters:
        colKeys - a collection of keys that may be in the named map
        Returns:
        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.

        Throws:
        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.

        Parameters:
        options - the configuration options
        Returns:
        asynchronous wrapper for this NamedMap
      • 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 storage-enabled members.
        Returns:
        return true if the NamedMap may be used otherwise returns false.
        Since:
        14.1.1.2206.5
      • 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
        Returns:
        true if the cache is active, otherwise false