|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DistributedNioMap is a high performance map specifically designed for storing java.nio.Buffer objects. When a cached object is being removed from cache and the cached object implements the DistributedNioMapObject interface, the DistributedNioMapObject.release() method will be called to notify the cache object it is being removed from cache.
Method Summary | |
---|---|
void |
addAlias(java.lang.Object key,
java.lang.Object[] aliasArray)
Adds an alias for the given key in the cache's mapping table. |
void |
clear()
Removes all mappings from this DistributedNioMap. |
boolean |
containsKey(java.lang.Object key,
boolean includeDiskCache)
Returns true if this map contains mapping for the specified key. |
CacheEntry |
getCacheEntry(java.lang.Object key)
Returns the cache entry which maps the specified key. |
void |
invalidate(java.lang.Object key)
Invalidates the given key. |
void |
invalidate(java.lang.Object key,
boolean wait)
Invalidates the given key. |
boolean |
isEmpty(boolean includeDiskCache)
Returns true if this map contains no key-value mappings. |
void |
put(java.lang.Object key,
java.lang.Object value,
java.lang.Object userMetaData,
int priority,
int timeToLive,
int sharingPolicy,
java.lang.Object[] dependencyIds,
java.lang.Object[] alias)
Associates the specified value with the specified key in this map. |
CacheEntry |
putAndGet(java.lang.Object key,
java.lang.Object value,
java.lang.Object userMetaData,
int priority,
int timeToLive,
int sharingPolicy,
java.lang.Object[] dependencyIds,
java.lang.Object[] alias)
Associates the specified value with the specified key in this map. |
void |
releaseLruEntries(int numOfEntries)
Use this method to release LRU cache entries (regular objects or ByteByffers/MetaData). |
void |
removeAlias(java.lang.Object alias)
Removes an alias from the cache's mapping table. |
int |
size(boolean includeDiskCache)
Returns the total number of key-value mappings. |
Method Detail |
public CacheEntry getCacheEntry(java.lang.Object key)
key
- key whose associated value is to be returned.
java.lang.ClassCastException
- if the key is not of an inappropriate type for
this map. (Currently supports only type String)
java.lang.NullPointerException
- key is null and this map does not
not permit null keys.public void put(java.lang.Object key, java.lang.Object value, java.lang.Object userMetaData, int priority, int timeToLive, int sharingPolicy, java.lang.Object[] dependencyIds, java.lang.Object[] alias)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.userMetaData
- userMetaData for the cache entry.priority
- the priority value for the cache entry. entries
with higher priority will remain in the cache longer
than those with a lower priority in the case of cache
overflow.timeToLive
- the time in seconds that the cache entry should remain
in the cachesharingPolicy
- how the cache entry should be shared in a cluster.
values are EntryInfo.NOT_SHARED, EntryInfo.SHARED_PUSH,
and EntryInfo.SHARED_PUSH_PULL.dependencyIds
- an optional set of dependency ids to associate with
the cache entryalias
- an optional set of alias ids to associate with the cache entry
java.lang.UnsupportedOperationException
- if the put operation is
not supported by this map.
java.lang.ClassCastException
- if the class of the specified key or value
prevents it from being stored in this map.
java.lang.IllegalArgumentException
- if some aspect of this key or value
prevents it from being stored in this map.
java.lang.NullPointerException
- this map does not permit null
keys or values, and the specified key or value is
null.DistributedNioMapObject
public CacheEntry putAndGet(java.lang.Object key, java.lang.Object value, java.lang.Object userMetaData, int priority, int timeToLive, int sharingPolicy, java.lang.Object[] dependencyIds, java.lang.Object[] alias)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.userMetaData
- userMetaData for the cache entry.priority
- the priority value for the cache entry. entries
with higher priority will remain in the cache longer
than those with a lower priority in the case of cache
overflow.timeToLive
- the time in seconds that the cache entry should remain
in the cachesharingPolicy
- how the cache entry should be shared in a cluster.
values are EntryInfo.NOT_SHARED, EntryInfo.SHARED_PUSH,
and EntryInfo.SHARED_PUSH_PULL.dependencyIds
- an optional set of dependency ids to associate with
the cache entryalias
- an optional set of alias ids to associate with the cache entry
java.lang.UnsupportedOperationException
- if the put operation is
not supported by this map.
java.lang.ClassCastException
- if the class of the specified key or value
prevents it from being stored in this map.
java.lang.IllegalArgumentException
- if some aspect of this key or value
prevents it from being stored in this map.
java.lang.NullPointerException
- this map does not permit null
keys or values, and the specified key or value is
null.DistributedNioMapObject
public void invalidate(java.lang.Object key, boolean wait)
key
- the key which will be invalidatedwait
- if true, then the method will not complete until the invalidation
has occured. if false, then the invalidation will occur in batch modepublic void invalidate(java.lang.Object key)
key
- the key which will be invalidatedpublic void clear()
public void addAlias(java.lang.Object key, java.lang.Object[] aliasArray)
key
- the key assoicated with aliasaliasArray
- the alias to use for lookups
java.lang.IllegalArgumentException
- if the key is not in the cache's mapping table.public void removeAlias(java.lang.Object alias)
alias
- the alias to move out of the cache's mapping tablepublic void releaseLruEntries(int numOfEntries)
numOfEntries
- the number of cache entries to be releasedpublic int size(boolean includeDiskCache)
includeDiskCache
- true to get the size of the memory and disk maps; false to get the size of memory map.
public boolean isEmpty(boolean includeDiskCache)
includeDiskCache
- true to check the memory and disk maps; false to check the memory map.
public boolean containsKey(java.lang.Object key, boolean includeDiskCache)
key
- whose presence in this map is to be tested.includeDiskCache
- true to check the specified key contained in the memory or disk maps; false to check the specified key contained in the memory map.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |