|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.ConverterCollections.ConverterMap
com.tangosol.util.ConverterCollections.ConverterConcurrentMap
public static class ConverterCollections.ConverterConcurrentMap
A Converter ConcurrentMap views an underlying ConcurrentMap through a set of key and value Converters.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry |
Field Summary |
---|
Fields inherited from class com.tangosol.util.ConverterCollections.ConverterMap |
---|
m_convKeyDown, m_convKeyUp, m_convValDown, m_convValUp, m_map, m_set |
Fields inherited from interface com.tangosol.util.ConcurrentMap |
---|
LOCK_ALL |
Constructor Summary | |
---|---|
ConverterCollections.ConverterConcurrentMap(ConcurrentMap map, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown) Constructor. |
Method Summary | |
---|---|
ConcurrentMap |
getConcurrentMap() Return the underlying ConcurrentMap. |
boolean |
lock(java.lang.Object oKey) Attempt to lock the specified item and return immediately. |
boolean |
lock(java.lang.Object oKey, long cWait) Attempt to lock the specified item within the specified period of time. |
boolean |
unlock(java.lang.Object oKey) Unlock the specified item. |
Methods inherited from class com.tangosol.util.ConverterCollections.ConverterMap |
---|
clear, containsKey, containsValue, entrySet, equals, get, getConverterKeyDown, getConverterKeyUp, getConverterValueDown, getConverterValueUp, getMap, hashCode, instantiateCollection, instantiateEntrySet, instantiateMap, instantiateSet, isEmpty, keySet, put, putAll, remove, size, toString, values |
Methods inherited from interface com.tangosol.util.ConcurrentMap |
---|
clear, containsKey, containsValue, get, isEmpty, put, putAll, remove, size |
Methods inherited from interface java.util.Map |
---|
entrySet, equals, hashCode, keySet, values |
Constructor Detail |
---|
public ConverterCollections.ConverterConcurrentMap(ConcurrentMap map, Converter convKeyUp, Converter convKeyDown, Converter convValUp, Converter convValDown)
map
- the underlying ConcurrentMapconvKeyUp
- the Converter to view the underlying ConcurrentMap's keys throughconvKeyDown
- the Converter to use to pass keys down to the underlying ConcurrentMapconvValUp
- the Converter to view the underlying ConcurrentMap's values throughconvValDown
- the Converter to use to pass values down to the underlying ConcurrentMapMethod Detail |
---|
public boolean lock(java.lang.Object oKey)
This method behaves exactly as if it simply performs the call lock(oKey, 0).
lock
in interface ConcurrentMap
oKey
- key being lockedpublic boolean lock(java.lang.Object oKey, long cWait)
The item doesn't have to exist to be locked. While the item is locked there is known to be a lock holder which has an exclusive right to modify (calling put and remove methods) that item.
Lock holder is an abstract concept that depends on the ConcurrentMap implementation. For example, holder could be a cluster member or a thread (or both).
Locking strategy may vary for concrete implementations as well. Lock could have an expiration time (this lock is sometimes called a "lease") or be held indefinitely (until the lock holder terminates).
Some implementations may allow the entire map to be locked. If the map is locked in such a way, then only a lock holder is allowed to perform any of the "put" or "remove" operations. Pass the special constant ConcurrentMap.LOCK_ALL
as the oKey parameter to indicate the map lock.
lock
in interface ConcurrentMap
oKey
- key being lockedcWait
- the number of milliseconds to continue trying to obtain a lock; pass zero to return immediately; pass -1 to block the calling thread until the lock could be obtainedpublic boolean unlock(java.lang.Object oKey)
unlock
in interface ConcurrentMap
oKey
- key being unlockedpublic ConcurrentMap getConcurrentMap()
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |