|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
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.InvocableMapHelper
public abstract class InvocableMapHelper
Helper methods for InvocableMap implementations and Filter related evaluation.
Nested Class Summary | |
---|---|
protected static class |
InvocableMapHelper.IndexAdapter MapListener implementation that routes the map events into the corresponding MapIndex calls. |
protected static class |
InvocableMapHelper.RoutingBinaryEntry BinaryEntry wrapper that routes the getValue()/getBinaryValue() calls onto getOriginalValue()/getOriginalBinaryValue(). |
protected static class |
InvocableMapHelper.RoutingMapTriggerEntry MapTrigger.Entry wrapper that routes the getValue() call onto getOriginalValue(). |
static class |
InvocableMapHelper.SimpleEntry Simple implementation of the InvocableMap.Entry interface. |
Field Summary | |
---|---|
static Converter |
ENTRY_TO_KEY_CONVERTER Trivial Entry-to-Key converter. |
Constructor Summary | |
---|---|
InvocableMapHelper() |
Method Summary | |
---|---|
static void |
addIndex(ValueExtractor extractor, boolean fOrdered, java.util.Comparator comparator, ObservableMap map, java.util.Map mapIndex) Add an index to the given map of indexes, keyed by the given extractor. |
protected static MapListener |
ensureListener(MapIndex index) Ensure a MapListener for the given index. |
static boolean |
evaluateEntry(Filter filter, java.util.Map.Entry entry) Check if the entry passes the filter evaluation. |
static boolean |
evaluateEntry(Filter filter, java.lang.Object oKey, java.lang.Object oValue) Check if an entry, expressed as a key and value, passes the filter evaluation. |
static boolean |
evaluateOriginalEntry(Filter filter, MapTrigger.Entry entry) Check if the entry, in its "original" form, passes the filter evaluation. |
static java.lang.Object |
extractFromEntry(ValueExtractor extractor, java.util.Map.Entry entry) Extract a value from the specified entry using the specified extractor. |
static java.lang.Object |
extractOriginalFromEntry(ValueExtractor extractor, MapTrigger.Entry entry) Extract a value from the "original value" of the specified entry using the specified extractor. |
static java.util.Map |
invokeAllLocked(ConcurrentMap map, java.util.Set setEntries, InvocableMap.EntryProcessor agent) Invoke the passed EntryProcessor against the entries specified by the passed map and entries. |
static java.lang.Object |
invokeLocked(ConcurrentMap map, InvocableMap.Entry entry, InvocableMap.EntryProcessor agent) Invoke the passed EntryProcessor against the specified Entry. |
static java.util.List |
lockAll(ConcurrentMap map, java.util.Collection collKeys, long cWait) Attempt to lock all the specified keys within a specified period of time. |
static InvocableMapHelper.SimpleEntry |
makeEntry(java.util.Map map, java.lang.Object oKey) Create a SimpleEntry object for the specified map and the key. |
static java.util.Set |
makeEntrySet(java.util.Collection collEntries) Create a set of read-only SimpleEntry objects for the specified collection of Map.Entry objects. |
static java.util.Set |
makeEntrySet(java.util.Map map, java.util.Collection collKeys, boolean fReadOnly) Create a set of SimpleEntry objects for the specified map and the key collection. |
static java.util.Set |
query(java.util.Map map, Filter filter, boolean fEntries, boolean fSort, java.util.Comparator comparator) Generic implementation of the QueryMap API. |
static java.util.Set |
query(java.util.Map map, java.util.Map mapIndexes, Filter filter, boolean fEntries, boolean fSort, java.util.Comparator comparator) Generic implementation of the QueryMap API. |
static void |
removeIndex(ValueExtractor extractor, ObservableMap map, java.util.Map mapIndex) Remove the index keyed by the given extractor from the given map of indexes. |
static void |
unlockAll(ConcurrentMap map, java.util.Collection collKeys) Unlock all the specified keys. |
static void |
updateEntry(ValueUpdater updater, java.util.Map.Entry entry, java.lang.Object oValue) Update the specified entry using the specified updater and value. |
Field Detail |
---|
public static final Converter ENTRY_TO_KEY_CONVERTER
Constructor Detail |
---|
public InvocableMapHelper()
Method Detail |
---|
public static java.lang.Object invokeLocked(ConcurrentMap map, InvocableMap.Entry entry, InvocableMap.EntryProcessor agent)
map
- the ConcurrentMap that the EntryProcessor works againstentry
- the InvocableMap.Entry to process; it is not required to exist within the Mapagent
- the EntryProcessor to use to process the specified keypublic static java.util.Map invokeAllLocked(ConcurrentMap map, java.util.Set setEntries, InvocableMap.EntryProcessor agent)
map
- the ConcurrentMap that the EntryProcessor works againstsetEntries
- a set of InvocableMap.Entry objects to processagent
- the EntryProcessor to use to process the specified keyspublic static java.util.List lockAll(ConcurrentMap map, java.util.Collection collKeys, long cWait)
map
- the ConcurrentMap to usecollKeys
- a collection of keys to lockcWait
- the number of milliseconds to continue trying to obtain locks; pass zero to return immediately; pass -1 to block the calling thread until the lock could be obtainedpublic static void unlockAll(ConcurrentMap map, java.util.Collection collKeys)
map
- the ConcurrentMap to usecollKeys
- a collection of keys to unlockpublic static InvocableMapHelper.SimpleEntry makeEntry(java.util.Map map, java.lang.Object oKey)
map
- the ConcurrentMap to create entries foroKey
- the key to create an entry for; the key is not required to exist within the Mappublic static java.util.Set makeEntrySet(java.util.Map map, java.util.Collection collKeys, boolean fReadOnly)
map
- the Map to create entries forcollKeys
- collection of keys to create entries for; these keys are not required to exist within the MapfReadOnly
- if true, the returned entries will be marked as read-onlypublic static java.util.Set makeEntrySet(java.util.Collection collEntries)
collEntries
- collection of Map.Entry objects to create SimpleEntry objects forpublic static boolean evaluateEntry(Filter filter, java.util.Map.Entry entry)
filter
- the filter to evaluate againstentry
- a key value pair to filterpublic static boolean evaluateEntry(Filter filter, java.lang.Object oKey, java.lang.Object oValue)
filter
- the filter to evaluate againstoKey
- the key for the entryoValue
- the value for the entrypublic static boolean evaluateOriginalEntry(Filter filter, MapTrigger.Entry entry)
filter
- the filter to evaluate againstentry
- the entry whose "original" value to evaluatepublic static java.lang.Object extractFromEntry(ValueExtractor extractor, java.util.Map.Entry entry)
extractor
- the extractor to useentry
- the entry to extract frompublic static java.lang.Object extractOriginalFromEntry(ValueExtractor extractor, MapTrigger.Entry entry)
extractor
- the extractor to useentry
- the entry to extract frompublic static void updateEntry(ValueUpdater updater, java.util.Map.Entry entry, java.lang.Object oValue)
updater
- the updater to useentry
- the entry to updateoValue
- the new valuepublic static java.util.Set query(java.util.Map map, Filter filter, boolean fEntries, boolean fSort, java.util.Comparator comparator)
QueryMap
API.map
- the underlying Mapfilter
- the FilterfEntries
- if true, return an entry-set; otherwise a key-setfSort
- if true, sort the entry-set before returningcomparator
- the Comparator to use for sorting (optional)public static java.util.Set query(java.util.Map map, java.util.Map mapIndexes, Filter filter, boolean fEntries, boolean fSort, java.util.Comparator comparator)
QueryMap
API.map
- the underlying MapmapIndexes
- the map of available MapIndex
objects keyed by the related ValueExtractor; read-onlyfilter
- the FilterfEntries
- if true, return an entry-set; otherwise a key-setfSort
- if true, sort the entry-set before returningcomparator
- the Comparator to use for sorting (optional)public static void addIndex(ValueExtractor extractor, boolean fOrdered, java.util.Comparator comparator, ObservableMap map, java.util.Map mapIndex)
extractor
- the ValueExtractor object that is used to extract an indexable property value from a resource map entryfOrdered
- true if the contents of the indexed information should be ordered; false otherwisecomparator
- the Comparator object which imposes an ordering on entries in the indexed map or null if the entries' values natural ordering should be usedmap
- the resource map that the newly created MapIndex will use for initialization and listen to for changesmapIndex
- the map of indexes that the newly created MapIndex will be added topublic static void removeIndex(ValueExtractor extractor, ObservableMap map, java.util.Map mapIndex)
extractor
- the ValueExtractor object that is used to extract an indexable Object from a value stored in the Map.map
- the resource map to remove the index formapIndex
- the map of indexes to remove the MapIndex fromprotected static MapListener ensureListener(MapIndex index)
index
- the index
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |