|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NamedCache
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. <p/> Note: When using the Coherence Enterprise Edition or Grid Edition, the Partitioned Cache implements the InvocableMap interface by partitioning and localizing the invocations, resulting in extremely high throughput and low latency. When using Coherence Standard Edition, the InvocableMap processes the invocations on the originating node, typically resulting in higher network, memory and CPU utilization, which translates to lower performance, and particularly when processing large data sets. <p/> Note: When using the Coherence Enterprise Edition or Grid Edition, the Partitioned Cache implements the QueryMap interface using the Parallel Query feature. When using Coherence Standard Edition, the Parallel Query feature is not available, resulting in lower performance for most queries, and particularly when querying large data sets.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.tangosol.util.QueryMap |
---|
QueryMap.Entry |
Nested classes/interfaces inherited from interface com.tangosol.util.InvocableMap |
---|
InvocableMap.Entry, InvocableMap.EntryAggregator, InvocableMap.EntryProcessor, InvocableMap.ParallelAwareAggregator |
Field Summary |
---|
Fields inherited from interface com.tangosol.net.cache.CacheMap |
---|
EXPIRY_DEFAULT, EXPIRY_NEVER |
Fields inherited from interface com.tangosol.util.ConcurrentMap |
---|
LOCK_ALL |
Method Summary | |
---|---|
void |
destroy() Release and destroy this instance of NamedCache. |
String |
getCacheName() Return the cache name. |
CacheService |
getCacheService() Return the CacheService that this NamedCache is a part of. |
boolean |
isActive() Specifies whether or not the NamedCache is active. |
Object |
put(Object oKey, Object oValue, long cMillis) Associates the specified value with the specified key in this cache and allows to specify an expiry for the cache entry. |
void |
release() Release local resources associated with this instance of NamedCache. |
Methods inherited from interface com.tangosol.net.cache.CacheMap |
---|
getAll, put |
Methods inherited from interface com.tangosol.util.ConcurrentMap |
---|
clear, containsKey, containsValue, get, isEmpty, lock, lock, put, putAll, remove, size, unlock |
Methods inherited from interface com.tangosol.util.QueryMap |
---|
addIndex, entrySet, entrySet, keySet, removeIndex |
Methods inherited from interface com.tangosol.util.InvocableMap |
---|
aggregate, aggregate, invoke, invokeAll, invokeAll |
Method Detail |
---|
String getCacheName()
CacheService getCacheService()
boolean isActive()
void release()
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 afterward will result in an exception.
Caches should be released by the same mechanism in which they were obtained. For example:
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.
CacheFactory.releaseCache(NamedCache)
, ConfigurableCacheFactory.releaseCache(NamedCache)
void destroy()
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 internal resources will be released.
Caches should be destroyed by the same mechansim in which they were obtained. For example:
CacheFactory.destroyCache(NamedCache)
, ConfigurableCacheFactory.destroyCache(NamedCache)
Object put(Object oKey, Object oValue, long cMillis)
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.)
put
in interface CacheMap
oKey
- key with which the specified value is to be associatedoValue
- value to be associated with the specified keycMillis
- 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()UnsupportedOperationException
- if the requested expiry is a positive value and the implementation does not support expiry of cache entries
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |