A NamedCache is a Map that holds resources shared among members of a cluster.
These resources are expected to be managed in memory, and are typically
composed of data that are also stored persistently in a database, or data
that have been assembled or calculated at some significant cost,
thus these resources are referred to as cached.

Note: The InvocableMap feature is a Coherence Enterprise Edition feature.
In Coherence Clustered Edition, the InvocableMap methods may throw an
exception.

Note: The Partitioned Cache implements the QueryMap interface using the
Parallel Query feature, which is only available in the Coherence Enterprise
Edition. When using a Partitioned Cache in the Coherence Clustered Edition,
the QueryMap methods may throw an exception.

isActive

release

void release()

Release local resources associated with this instance of NamedCache.

Releasing a cache makes it no longer usable, but does not affect the
cache itself. In other words, all other references to the cache will still
be valid, and the cache data is not affected by releasing the reference.
Any attempt to use this reference afterword will result in an exception.

The purpose for releasing a cache is to allow the cache implementation
to release the ClassLoader used to deserialize items
in the cache. The cache implementation ensures that all references to
that ClassLoader are released. This implies that objects in the cache
that were loaded by that ClassLoader will be re-serialized to release
their hold on that ClassLoader. The result is that the ClassLoader can
be garbage-collected by Java in situations where the cache is operating
in an application server and applications are dynamically loaded and
unloaded.

destroy

void destroy()

Release and destroy this instance of NamedCache.

Warning: This method is used to completely destroy the specified
cache across the cluster. All references in the entire cluster to this
cache will be invalidated, the cached data will be cleared, and all
resources will be released.

put

Associates the specified value with the specified key in this cache and
allows to specify an expiry for the cache entry.

Note: Though NamedCache interface extends CacheMap,
not all implementations currently support this functionality.

For example, if a cache is configured to be a
replicated,
optimistic
or
distributed
cache then its backing map must be configured as a
local cache.
If a cache is configured to be a
near cache
then the front map must to be configured as a local cache and the back map must support this feature as well,
typically by being a distributed cache backed by a local cache (as above.)

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:

previous value associated with specified key, or null
if there was no mapping for key. A null return can
also indicate that the map previously associated null
with the specified key, if the implementation supports
null values