#include <coherence/util/ConverterCollections.hpp>
Inherits ConverterCollections::ConverterCacheMap, and NamedCache.
Public Types | ||||||||||
typedef spec::Handle | Handle | |||||||||
ConverterNamedCache Handle definition. | ||||||||||
typedef spec::View | View | |||||||||
ConverterNamedCache View definition. | ||||||||||
typedef spec::Holder | Holder | |||||||||
ConverterNamedCache Holder definition. | ||||||||||
Public Member Functions | ||||||||||
virtual String::View | getCacheName () const | |||||||||
Return the cache name. | ||||||||||
virtual CacheService::Handle | getCacheService () | |||||||||
Return the CacheService that this NamedCache is a part of. | ||||||||||
virtual CacheService::View | getCacheService () const | |||||||||
Return the CacheService that this NamedCache is a part of. | ||||||||||
virtual bool | isActive () const | |||||||||
Specifies whether or not the NamedCache is active. | ||||||||||
virtual void | release () | |||||||||
Release local resources associated with this instance of NamedCache. | ||||||||||
virtual void | destroy () | |||||||||
Release and destroy this instance of NamedCache. | ||||||||||
virtual bool | lock (Object::View vKey, int64_t cWait) const | |||||||||
Attempt to lock the specified item within the specified period of time. 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 process 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 getLockAll() as the vKey parameter to indicate the map lock.
| ||||||||||
virtual bool | lock (Object::View vKey) const | |||||||||
Attempt to lock the specified item and return immediately.
This method behaves exactly as if it simply performs the call
| ||||||||||
virtual bool | unlock (Object::View vKey) const | |||||||||
Unlock the specified item. The item doesn't have to exist to be unlocked. If the item is currently locked, only the holder of the lock could successfully unlock it.
| ||||||||||
virtual Object::Holder | invoke (Object::View vKey, InvocableMap::EntryProcessor::Handle hAgent) | |||||||||
Invoke the passed EntryProcessor against the Entry specified by the passed key, returning the result of the invocation.
| ||||||||||
virtual Map::View | invokeAll (Collection::View vCollKeys, InvocableMap::EntryProcessor::Handle hAgent) | |||||||||
Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.
| ||||||||||
virtual Map::View | invokeAll (Filter::View vFilter, InvocableMap::EntryProcessor::Handle hAgent) | |||||||||
Invoke the passed EntryProcessor against the entries specified by the passed keys, returning the result of the invocation for each.
| ||||||||||
virtual Object::Holder | aggregate (Collection::View vCollKeys, InvocableMap::EntryAggregator::Handle hAgent) const | |||||||||
Perform an aggregating operation against the entries specified by the passed keys.
| ||||||||||
virtual Object::Holder | aggregate (Filter::View vFilter, InvocableMap::EntryAggregator::Handle hAgent) const | |||||||||
Perform an aggregating operation against the entries specified by the passed keys.
| ||||||||||
virtual Set::View | keySet (Filter::View vFilter) const | |||||||||
Return a set of the keys contained in this map for entries that satisfy the criteria expressed by the filter. Unlike the Map#keySet() method, the set returned by this method may not be backed by the map, so changes to the set may not reflected in the map, and vice-versa.
| ||||||||||
virtual Set::View | entrySet (Filter::View vFilter) const | |||||||||
Return a set of the entries contained in this map that satisfy the criteria expressed by the filter. Each element in the returned set is a Map::Entry. Unlike the Map::entrySet() method, the set returned by this method may not be backed by the map, so changes to the set may not be reflected in the map, and vice-versa.
| ||||||||||
virtual Set::View | entrySet (Filter::View vFilter, Comparator::View vComparator) const | |||||||||
Return a set of the entries contained in this map that satisfy the criteria expressed by the filter. Each element in the returned set is a Map::Entry. It is further guaranteed that its iterator will traverse the set in such a way that the entry values come up in ascending order, sorted by the specified Comparator or according to the natural ordering (see Comparable). Unlike the Map::entrySet() method, the set returned by this method may not be backed by the map, so changes to the set may not be reflected in the map, and vice-versa.
| ||||||||||
virtual void | addIndex (ValueExtractor::View vExtractor, bool fOrdered, Comparator::View vComparator) | |||||||||
Add an index to this QueryMap.
This allows to correlate values stored in this indexed Map (or attributes of those values) to the corresponding keys in the indexed Map and increase the performance of This method is only intended as a hint to the cache implementation, and as such it may be ignored by the cache if indexes are not supported or if the desired index (or a similar index) already exists. It is expected that an application will call this method to suggest an index even if the index may already exist, just so that the application is certain that index has been suggested. For example in a distributed environment, each server will likely suggest the same set of indexes when it starts, and there is no downside to the application blindly requesting those indexes regardless of whether another server has already requested the same indexes.
| ||||||||||
virtual void | removeIndex (ValueExtractor::View vExtractor) | |||||||||
Remove an index from this QueryMap.
| ||||||||||
virtual NamedCache::View | getNamedCache () const | |||||||||
Return the underlying InvocableMap. | ||||||||||
virtual NamedCache::Handle | getNamedCache () | |||||||||
Return the underlying CacheMap. | ||||||||||
virtual ConcurrentMap::View | getConcurrentMap () const | |||||||||
Return the underlying ConcurrentMap. | ||||||||||
virtual ConcurrentMap::Handle | getConcurrentMap () | |||||||||
Return the underlying ConcurrentMap. | ||||||||||
virtual InvocableMap::View | getInvocableMap () const | |||||||||
Return the underlying InvocableMap. | ||||||||||
virtual InvocableMap::Handle | getInvocableMap () | |||||||||
Return the underlying InvocableMap. | ||||||||||
virtual QueryMap::View | getQueryMap () const | |||||||||
Return the underlying QueryMap. | ||||||||||
virtual QueryMap::Handle | getQueryMap () | |||||||||
Return the underlying QueryMap. | ||||||||||
Protected Member Functions | ||||||||||
ConverterNamedCache (NamedCache::Handle hMapDelegate, EntryConverter::View vConvUp, EntryConverter::View vConvDown) | ||||||||||
Create a ConverterQueryMap which delegates to the s pecified QueryMap. | ||||||||||
ConverterNamedCache (NamedCache::View vMapDelegate, EntryConverter::View vConvUp, EntryConverter::View vConvDown) | ||||||||||
Create a ConverterQueryMap which delegates to the s pecified QueryMap. | ||||||||||
Protected Attributes | ||||||||||
FinalHolder < ConverterConcurrentMap > | f_ohMapConcurrent | |||||||||
A Converter ConcurrentMap around the underlying NamedCache. | ||||||||||
FinalHolder < ConverterInvocableMap > | f_ohMapInvocable | |||||||||
A Converter InvocableMap around the underlying NamedCache. | ||||||||||
FinalHolder < ConverterQueryMap > | f_ohMapQuery | |||||||||
A Converter QueryMap around the underlying NamedCache. |
ConverterNamedCache | ( | NamedCache::Handle | hMapDelegate, | |
EntryConverter::View | vConvUp, | |||
EntryConverter::View | vConvDown | |||
) | [protected] |
Create a ConverterQueryMap which delegates to the s pecified QueryMap.
hMap | the specified InvocableMap | |
vConvUp | the EntryConverter from the underlying Map | |
vConvDown | the EntryConverter to the underlying Map |
ConverterNamedCache | ( | NamedCache::View | vMapDelegate, | |
EntryConverter::View | vConvUp, | |||
EntryConverter::View | vConvDown | |||
) | [protected] |
Create a ConverterQueryMap which delegates to the s pecified QueryMap.
vMap | the specified InvocableMap | |
vConvUp | the EntryConverter from the underlying Map | |
vConvDown | the EntryConverter to the underlying Map |
virtual String::View getCacheName | ( | ) | const [virtual] |
virtual CacheService::Handle getCacheService | ( | ) | [virtual] |
Return the CacheService that this NamedCache is a part of.
Implements NamedCache.
virtual CacheService::View getCacheService | ( | ) | const [virtual] |
Return the CacheService that this NamedCache is a part of.
Implements NamedCache.
virtual bool isActive | ( | ) | const [virtual] |
Specifies whether or not the NamedCache is active.
Implements NamedCache.
virtual void release | ( | ) | [virtual] |
Release local resources associated with this instance of NamedCache.
Releasing a cache makes it no longer usable, but does not affect the cache itself. In other words, all other references to the cache will still be valid, and the cache data is not affected by releasing the reference. Any attempt to use this reference afterword will result in an exception.
Implements NamedCache.
virtual void destroy | ( | ) | [virtual] |
Release and destroy this instance of NamedCache.
Warning: This method is used to completely destroy the specified cache across the cluster. All references in the entire cluster to this cache will be invalidated, the cached data will be cleared, and all resources will be released.
Implements NamedCache.
virtual NamedCache::View getNamedCache | ( | ) | const [virtual] |
virtual NamedCache::Handle getNamedCache | ( | ) | [virtual] |
Return the underlying CacheMap.
virtual ConcurrentMap::View getConcurrentMap | ( | ) | const [virtual] |
virtual ConcurrentMap::Handle getConcurrentMap | ( | ) | [virtual] |
virtual InvocableMap::View getInvocableMap | ( | ) | const [virtual] |
virtual InvocableMap::Handle getInvocableMap | ( | ) | [virtual] |
virtual QueryMap::View getQueryMap | ( | ) | const [virtual] |
virtual QueryMap::Handle getQueryMap | ( | ) | [virtual] |