|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class provides applications with an extended java.util.Map interface to access the WebSphere Dynamic Cache, allowing inspection and manipulation of the cache. The cache does not have any authorization checking done before allowing access to its contents, so care should be taken on the type of data that is placed in the cache. The default WebSphere Dynamic Cache instance is created when the cache is enabled in the administration console and is bound into the global JNDI namespace with the name "services/cache/distributedmap". Additional cache instances can be created using a properties file distributedmap.properties with the following format:
Nested Class Summary |
---|
Nested classes inherited from class java.util.Map |
---|
java.util.Map.Entry |
Method Summary | |
---|---|
boolean |
addChangeListener(ChangeListener listener)
addChangeListener - adds a change listener for this DistributedMap. |
boolean |
addInvalidationListener(InvalidationListener listener)
addInvalidationListener - adds an invalidation listener for this DistributeMap. |
boolean |
enableListener(boolean enable)
enableListener - enable or disable the invalidation and change listener support. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which this map maps the specified key. |
int |
getSharingPolicy()
getSharingPolicy - gets the sharing policy for DistributedMap. |
void |
invalidate(java.lang.Object key)
invalidate - invalidates the given key. |
void |
invalidate(java.lang.Object key,
boolean wait)
invalidate - invalidates the given key. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in this map (optional operation). |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value,
int priority,
int timeToLive,
int sharingPolicy,
java.lang.Object[] dependencyIds)
Associates the specified value with the specified key in this map (optional operation). |
boolean |
removeChangeListener(ChangeListener listener)
removeChangeListener - removes a change listener for this DistributedMap. |
boolean |
removeInvalidationListener(InvalidationListener listener)
removeInvalidationListener - removes an invalidation listener for this DistributedMap. |
void |
setSharingPolicy(int sharingPolicy)
setSharingPolicy - sets the sharing policy for DistributedMap. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values |
Method Detail |
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
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 String)
java.lang.NullPointerException
- key is null and this map does not
not permit null keys.Map.containsKey(Object)
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
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.public java.lang.Object put(java.lang.Object key, java.lang.Object value, int priority, int timeToLive, int sharingPolicy, java.lang.Object[] dependencyIds)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.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,
EntryInfo.SHARED_PULL, and EntryInfo.SHARED_PUSH_PULLdependencyIds
- an optional set of dependency 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.public void setSharingPolicy(int sharingPolicy)
sharingPolicy
- policy to set. Default is EntryInfo.NOT_SHAREDgetSharingPolicy()
public int getSharingPolicy()
setSharingPolicy(int)
public void invalidate(java.lang.Object key)
key
- the key which will be invalidatedMap.remove(Object key)
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 modeMap.remove(Object key)
public boolean enableListener(boolean enable)
enable
- - true to enable support for invalidation and change listeners
or false to disable support for invalidation and change listeners
public boolean addInvalidationListener(InvalidationListener listener)
listener
- the invalidation listener object
removeInvalidationListener(com.ibm.websphere.cache.InvalidationListener)
public boolean removeInvalidationListener(InvalidationListener listener)
listener
- the invalidation listener object
addInvalidationListener(com.ibm.websphere.cache.InvalidationListener)
public boolean addChangeListener(ChangeListener listener)
listener
- the change listener object
removeChangeListener(com.ibm.websphere.cache.ChangeListener)
public boolean removeChangeListener(ChangeListener listener)
listener
- the change listener object
addChangeListener(com.ibm.websphere.cache.ChangeListener)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |