|
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 |
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. |
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, Comparator comparator, ObservableMap map, 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, Map.Entry entry) Check if the entry passes the filters evaluation. |
static boolean |
evaluateEntry(Filter filter, Object oKey, Object oValue) Check if an entry, expressed as a key and value, passes the filters evaluation. |
static Object |
extractFromEntry(ValueExtractor extractor, Map.Entry entry) Extract a value from the specified entry using the specified extractor. |
static Object |
extractOriginalFromEntry(ValueExtractor extractor, MapTrigger.Entry entry) Extract a value from the "original value" of the specified entry using the specified extractor. |
static Map |
invokeAllLocked(ConcurrentMap map, Set setEntries, InvocableMap.EntryProcessor agent) Invoke the passed EntryProcessor against the entries specified by the passed map and entries. |
static Object |
invokeLocked(ConcurrentMap map, InvocableMap.Entry entry, InvocableMap.EntryProcessor agent) Invoke the passed EntryProcessor against the specified Entry. |
static List |
lockAll(ConcurrentMap map, Collection collKeys, long cWait) Attempt to lock all the specified keys within a specified period of time. |
static InvocableMapHelper.SimpleEntry |
makeEntry(Map map, Object oKey) Create a SimpleEntry object for the specified map and the key. |
static Set |
makeEntrySet(Collection collEntries) Create a set of read-only SimpleEntry objects for the specified collection of Map.Entry objects. |
static Set |
makeEntrySet(Map map, Collection collKeys, boolean fReadOnly) Create a set of SimpleEntry objects for the specified map and the key collection. |
static Set |
query(Map map, Filter filter, boolean fEntries, boolean fSort, Comparator comparator) Generic implementation of the QueryMap API. |
static Set |
query(Map map, Map mapIndexes, Filter filter, boolean fEntries, boolean fSort, Comparator comparator) Generic implementation of the QueryMap API. |
static void |
removeIndex(ValueExtractor extractor, ObservableMap map, Map mapIndex) Remove the index keyed by the given extractor from the given map of indexes. |
static void |
unlockAll(ConcurrentMap map, Collection collKeys) Unlock all the specified keys. |
static void |
updateEntry(ValueUpdater updater, Map.Entry entry, 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 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 Map invokeAllLocked(ConcurrentMap map, 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 List lockAll(ConcurrentMap map, 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, Collection collKeys)
map
- the ConcurrentMap to usecollKeys
- a collection of keys to unlockpublic static InvocableMapHelper.SimpleEntry makeEntry(Map map, 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 Set makeEntrySet(Map map, 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 Set makeEntrySet(Collection collEntries)
collEntries
- collection of Map.Entry objects to create SimpleEntry objects forpublic static boolean evaluateEntry(Filter filter, Map.Entry entry)
filter
- the filter to evaluate againstentry
- a key value pair to filterpublic static boolean evaluateEntry(Filter filter, Object oKey, Object oValue)
filter
- the filter to evaluate againstoKey
- the key for the entryoValue
- the value for the entrypublic static Object extractFromEntry(ValueExtractor extractor, Map.Entry entry)
extractor
- the extractor to useentry
- the entry to extract frompublic static Object extractOriginalFromEntry(ValueExtractor extractor, MapTrigger.Entry entry)
extractor
- the extractor to useentry
- the entry to extract frompublic static void updateEntry(ValueUpdater updater, Map.Entry entry, Object oValue)
updater
- the updater to useentry
- the entry to updateoValue
- the new valuepublic static Set query(Map map, Filter filter, boolean fEntries, boolean fSort, 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 Set query(Map map, Map mapIndexes, Filter filter, boolean fEntries, boolean fSort, 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, Comparator comparator, ObservableMap map, 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, 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 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |