Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.3.0)

E80355-01

ContinuousQueryCache Class Reference

#include <coherence/net/cache/ContinuousQueryCache.hpp>

Inherits AbstractMap, and NamedCache.

List of all members.


Detailed Description

Create a materialized view of a NamedCache using the Coherence Continuous Query capability.

Author:
tb, js 2008.07.23

Public Types

typedef spec::Handle Handle
 ContinuousQueryCache Handle definition.
typedef spec::View View
 ContinuousQueryCache View definition.
typedef spec::Holder Holder
 ContinuousQueryCache Holder definition.

Public Member Functions

virtual NamedCache::View getCache () const
 Obtain the NamedCache that this ContinuousQueryCache is based on.
virtual
NamedCache::Handle 
getCache ()
 Obtain the NamedCache that this ContinuousQueryCache is based on.
virtual Filter::View getFilter () const
 Obtain the Filter that this ContinuousQueryCache is using to query the underlying NamedCache.
virtual bool isCacheValues () const
 Determine if this ContinuousQueryCache caches values locally.
virtual void setCacheValues (bool fCacheValues)
 Modify the local-caching option for the ContinuousQueryCache.
virtual bool isReadOnly () const
 Determine if this ContinuousQueryCache disallows data modification operations.
virtual void setReadOnly (bool fReadOnly)
 Modify the read-only option for the ContinuousQueryCache.
virtual int32_t getState () const
 Obtain the state of the ContinousQueryCache.
virtual int64_t getReconnectInterval () const
 Return a reconnection interval (in milliseconds).
virtual void setReconnectInterval (int64_t cReconnectMillis)
 Specify a reconnection interval (in milliseconds).
virtual Object::Holder get (Object::View vKey) const
 Return the value to which this map maps the specified key.

Return NULL if the map contains no mapping for this key. A return value of NULL does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to NULL. The containsKey operation may be used to distinguish these two cases.

Parameters:
vKey key whose associated value is to be returned.
Returns:
the value to which this map maps the specified key, or NULL if the map contains no mapping for this key.
See also:
containsKey()

virtual Object::Holder put (Object::View vKey, Object::Holder ohValue)
 Associate the specified value with the specified key in this map.

If the map previously contained a mapping for this key, the old value is replaced by the specified value.

Parameters:
vKey key with which the specified value is to be associated.
ohValue value to be associated with the specified key.
Returns:
previous value associated with specified key, or NULL if there was no mapping for key. A NULL return can also indicate that the map previously associated NULL with the specified key.
Exceptions:
coherence::lang::UnsupportedOperationException if the put() operation is not supported by this map.

virtual Object::Holder remove (Object::View vKey)
 Remove the mapping for this key from this map if it is present.

Return the value to which the map previously associated the key, or NULL if the map contained no mapping for this key. (A NULL return can also indicate that the map previously associated NULL with the specified key.) The map will not contain a mapping for the specified key once the call returns.

Parameters:
vKey key whose mapping is to be removed from the map.
Returns:
previous value associated with specified key, or NULL if there was no mapping for key.
Exceptions:
coherence::lang::UnsupportedOperationException if the remove() operation is not supported by this map.

virtual void putAll (Map::View vMap)
 
virtual void clear ()
 Remove all mappings from this map.

Exceptions:
coherence::lang::UnsupportedOperationException if the clear()operation is not supported by this map.

virtual bool containsKey (Object::View vKey) const
 Return true if this map contains a mapping for the specified key.

Parameters:
vKey key whose presence in this map is to be tested.
Returns:
true if this map contains a mapping for the specified key.

virtual Set::View keySet () const
 Return a set of the keys contained in this map.

The set is backed by the map, so changes to the map are reflected in the set. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.

Returns:
a set of the keys contained in this map.

virtual Set::Handle keySet ()
 Return a set of the keys contained in this map.

The set is backed by the map, so changes to one are reflected in the other. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.

Returns:
a set of the keys contained in this map.

virtual Set::View entrySet () const
 Return a set of the mappings contained in this map.

Each element in the returned set is a Map::Entry::View. The set is backed by the map, so changes to the map are reflected in the set. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.

Returns:
a set of the mappings contained in this map.

virtual Set::Handle entrySet ()
 Return a set of the mappings contained in this map.

Each element in the returned set is a Map::Entry::Handle. The set is backed by the map, so changes to one are reflected in the other. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined.

Returns:
a set of the mappings contained in this map.

virtual size32_t size () const
 Return the number of key-value mappings in this map.

Returns:
the number of key-value mappings in this map.

virtual Map::View getAll (Collection::View vKeys) const
 Get all the specified keys, if they are in the cache.

For each key that is in the cache, that key and its corresponding value will be placed in the map that is returned by this method. The absence of a key in the returned map indicates that it was not in the cache, which may imply (for caches that can load behind the scenes) that the requested data could not be loaded.

The result of this method is defined to be semantically the same as the following implementation, without regards to threading issues:

 // could be a HashMap (but does not have to)
 Map::Handle hMap = SomeMap::create();

 for (Iterator::Handle iter = colKeys->iterator(); iter->hasNext();)
     {
     Object::View hKey = iter->next();
     Object::View hVal = get(hKey);
     if (hVal || containsKey(hKey))
         {
         hMap->put(hKey, hVal);
         }
     }
 return hMap;

Parameters:
vKeys a collection of keys that may be in the named cache
Returns:
a coherence::util::Map of keys to values for the specified keys passed in vKeys

virtual Object::Holder put (Object::View vKey, Object::Holder ohValue, int64_t cMillis)
 Associates the specified value with the specified key in this cache.

If the cache previously contained a mapping for this key, the old value is replaced. This variation of the put(Object::View, Object::View) method allows the caller to specify an expiry (or "time to live") for the cache entry.

Parameters:
vKey key with which the specified value is to be associated
ohValue value to be associated with the specified key
cMillis the number of milliseconds until the cache entry will expire, also referred to as the entry's "time to live"; pass expiry_default to use the cache's default time-to-live setting; pass expiry_never to indicate that the cache entry should never expire; this milliseconds value is not a date/time value
Returns:
previous value associated with specified key, or empty handle if there was no mapping for key. An empty handle return can also indicate that the map previously associated NULL with the specified key, if the implementation supports NULL values
Exceptions:
coherence::lang::UnsupportedOperationException if the requested expiry is a positive value and the implementation does not support expiry of cache entries

virtual void addKeyListener (MapListener::Handle hListener, Object::View vKey, bool fLite)
 
virtual void removeKeyListener (MapListener::Handle hListener, Object::View vKey)
 
virtual void addMapListener (MapListener::Handle hListener)
 
virtual void removeMapListener (MapListener::Handle hListener)
 
virtual void addFilterListener (MapListener::Handle hListener, Filter::View vFilter=NULL, bool fLite=false)
 
virtual void removeFilterListener (MapListener::Handle hListener, Filter::View vFilter=NULL)
 
virtual Set::View keySet (Filter::View vFilter) const
 
virtual Set::View entrySet (Filter::View vFilter) const
 
virtual Set::View entrySet (Filter::View vFilter, Comparator::View vComparator) const
 
virtual void addIndex (ValueExtractor::View vExtractor, bool fOrdered, Comparator::View vComparator)
 
virtual void removeIndex (ValueExtractor::View vExtractor)
 
virtual Object::Holder invoke (Object::View vKey, InvocableMap::EntryProcessor::Handle hAgent)
 
virtual Map::View invokeAll (Collection::View vCollKeys, InvocableMap::EntryProcessor::Handle hAgent)
 
virtual Map::View invokeAll (Filter::View vFilter, InvocableMap::EntryProcessor::Handle hAgent)
 
virtual Object::Holder aggregate (Collection::View vCollKeys, InvocableMap::EntryAggregator::Handle hAgent) const
 
virtual Object::Holder aggregate (Filter::View vFilter, InvocableMap::EntryAggregator::Handle hAgent) const
 
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.

Parameters:
vKey key being locked
cWait 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 obtained
Returns:
true if the item was successfully locked within the specified time; false otherwise

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 lock(vKey, 0).

Parameters:
vKey key being locked
Returns:
true if the item was successfully locked; false otherwise

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.

Parameters:
vKey key being unlocked
Returns:
true if the item was successfully unlocked; false otherwise

virtual String::View getCacheName () const
 Return the cache name.

Returns:
the cache name

virtual
CacheService::Handle 
getCacheService ()
 Return the CacheService that this NamedCache is a part of.

Returns:
the CacheService

virtual
CacheService::View 
getCacheService () const
 Return the CacheService that this NamedCache is a part of.

Returns:
the CacheService

virtual bool isActive () const
 Specifies whether or not the NamedCache is active.

Returns:
true if the NamedCache is active; false otherwise

virtual void release ()
 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 afterward will result in an exception.

Caches should be released by the same mechanism in which they were obtained. For example:

Except for the case where the application code explicitly allocated the cache, this method should not be called by application code.

See also:
CacheFactory::releaseCache

ConfigurableCacheFactory::releaseCache


virtual void destroy ()
 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.

Caches should be destroyed by the same mechanism in which they were obtained. For example:

Except for the case where the application code explicitly allocated the cache, this method should not be called by application code.

See also:
CacheService::destroyCache


Static Public Attributes

static const int32_t state_disconnected
 State: Disconnected state.
static const int32_t state_configuring
 State: The ContinuousQueryCache is configuring or re-configuring its listeners and content.
static const int32_t state_configured
 State: The ContinousQueryCache has been configured.
static const int32_t state_synchronized
 State: The ContinousQueryCache has been configured and fully synchronized.

Protected Member Functions

 ContinuousQueryCache (NamedCache::Handle hCache, Filter::View vFilter, bool fCacheValues=false, MapListener::Handle hListener=NULL, ValueExtractor::View vTransformer=NULL)
 Create a materialized view of a NamedCache using a Filter.
virtual
ObservableMap::Handle 
instantiateInternalCache ()
 Create the internal cache used by the ContinuousQueryCache.
virtual
ObservableMap::View 
getInternalCache () const
 Obtain a reference to the internal cache.
virtual
ObservableMap::Handle 
getInternalCache ()
 Obtain a reference to the internal cache.
virtual bool isObserved () const
 Determine if the ContinuousQueryCache has any listeners that cannot be served by this Map listening to lite events.
virtual void setObserved (bool fObserved)
 Specify whether the ContinuousQueryCache has any listeners that cannot be served by this Map listening to lite events.
virtual void changeState (int32_t nState) const
 Change the state of the ContinousQueryCache.
virtual Filter::View mergeFilter (Filter::View vFilter) const
 Return a filter which merges the ContinousQueueCache's filter with the supplied filter.
virtual void checkReadOnly () const
 Check the read-only setting to verify that the cache is NOT read-only.
virtual void checkEntry (Map::Entry::View vEntry)
 Check the passed value to verify that it does belong in this ContinuousQueryCache.
virtual void checkEntry (Object::View vKey, Object::Holder ohValue)
 Check the passed value to verify that it does belong in this ContinuousQueryCache.
virtual void configureSynchronization (bool fReload) const
 Set up the listeners that keep the ContinuousQueryCache up-to-date.
virtual Filter::View createTransformerFilter (MapEventFilter::View vFilterAdd) const
 Wrap specified MapEventFilter with a MapEventTransformerFilter that will either transform cache value using transformer defined for this ContinuousQueryCache, or remove the old value from the event using SemiLiteEventTransformer, if no transformer is defined for this CQC.
virtual void ensureSynchronized (bool fReload) const
 Ensure that the ContinousQueryCache listeners have been registered and its content synchronized with the underlying NamedCache.
virtual bool isEventDeferred (Object::View vKey) const
 Called when an event has occurred.
virtual bool removeBlind (Object::View vKey)
 Removes the mapping for this key from this map if present.
virtual Set::View getInternalKeySet () const
 Obtain a set of keys that are represented by this Map.
virtual
NamedCache::Handle 
getCacheInternal () const
 Return the underlying cache.
virtual
MapListener::Handle 
instantiateAddListener () const
 Factory Method: Instantiate a MapListener for adding items to the query, and (if there are listeners on the ContinuousQueryCache) for dispatching inserts and updates.
virtual
MapListener::Handle 
instantiateRemoveListener () const
 Factory Method: Instantiate a MapListener for evicting items from the query.
virtual void registerServiceListener () const
 Instantiate and register a MemberListener with the underlying caches's service.
virtual void unregisterServiceListener ()
 Unregister underlying caches's service member listener.
virtual
MultiplexingMapListener::Handle 
instantiateEventRouter (MapListener::Handle hListener)
 Factory Method: Instantiate a listener on the internal map that will direct events to the passed listener, either synchronously or asynchronously as appropriate.
virtual
TaskDaemon::Handle 
instantiateEventQueue ()
 Create a self-processing event queue.
virtual
TaskDaemon::Handle 
getEventQueue ()
 Obtain this ContinuousQueryCache's event queue.
virtual
TaskDaemon::Handle 
ensureEventQueue ()
 Obtain the existing event queue or create one if none exists.
virtual void shutdownEventQueue ()
 Shut down running event queue.
virtual Set::Handle instantiateKeySet ()
 Create a new key set.
virtual Set::Handle instantiateEntrySet ()
 Create a new EntrySet.
virtual Map::Handle ensureIndexMap ()
 Ensure that the map of indexes maintained by this cache exists.
virtual Map::View getIndexMap () const
 Get the map of indexes maintained by this cache.
virtual Map::Handle getIndexMap ()
 Get the map of indexes maintained by this cache.
virtual void releaseIndexMap ()
 Release the the entire index map.
virtual void onInit ()
 Event called once the Object has finished being constructed.

Specifically when the first attachment is made. This provides a safe point at which Handles/Views to "this" can be created. It is not safe to create Handles/Views to an Object from within its constructor, thus any operations which rely upon this should be deferred until the onInit event is triggered.

As with all event methods any derived implementation should include a call to the super class's implementation. Specifically delegation to Object::onInit() must eventually occur or an IllegalStateException will result.

The default implementation calls the onInit() method of each of the Object's SmartMembers.


Protected Attributes

MemberHandle
< NamedCache
m_hCache
 The underlying NamedCache object.
FinalView< Stringf_vsName
 The name of the underlying NamedCache.
FinalView< Filterf_vFilter
 The filter that represents the subset of information from the underlying NamedCache that this ContinuousQueryCache represents.
bool m_fCacheValues
 The option of whether or not to locally cache values.
bool m_fReadOnly
 The option to disallow modifications through this ContinuousQueryCache interface.
int64_t m_cReconnectMillis
 The interval (in millisceonds) that indicates how often the ContinuousQueryCache should attempt to synchronize its content with the underlying cache in case the connection is severed.
Volatile< int64_t > m_ldtConnectionTimestamp
 The timestamp when the synchronization was last attempted.
MemberHandle
< ObservableMap
m_hMapLocal
 The keys that are in this ContinuousQueryCache, and (if m_fCacheValues is true) the corresponding values as well.
Volatile< int32_t > m_nState
 State of the ContinousQueryCache.
MemberHandle< Mapm_hMapSyncReq
 While the ContinuousQueryCache is configuring or re-configuring its listeners and content, any events that are received must be logged to ensure that the corresponding content is in sync.
MemberHandle
< TaskDaemon
m_hTaskQueue
 The event queue for this ContinuousQueryCache.
bool m_fListeners
 Keeps track of whether the ContinuousQueryCache has listeners that require this cache to cache values.
MemberView
< MapEventFilter
m_vFilterAdd
 The MapEventFilter that uses the ContinuousQueryCache's filter to select events that would add elements to this cache's contents.
MemberView
< MapEventFilter
m_vFilterRemove
 The MapEventFilter that uses the ContinuousQueryCache's filter to select events that would remove elements from this cache's contents.
WeakHandle< MapListenerm_whListenerAdd
 The listener that gets information about what should be in this cache.
WeakHandle< MapListenerm_whListenerRemove
 The listener that gets information about what should be thrown out of this cache.
WeakHandle
< MemberListener
m_whListenerService
 The cache service MemberListener for the underlying NamedCache.
FinalView
< ValueExtractor
f_vTransformer
 The transformer that should be used to convert values from the underlying cache.
FinalHandle< Mapf_hMapIndex
 The map of indexes maintained by this cache.
FinalHandle< Setf_hSetKeys
 KeySet backed by this cache.
FinalHandle< Setf_hSetEntries
 EntrySet backed by this cache.

Classes

class  AsynchronousEvent
 Encapsulates an event and a listener that are to be dispatched asynchronously. More...
class  TaskDaemon
 Daemon thread used to dispatch messages asynchronously. More...

Constructor & Destructor Documentation

ContinuousQueryCache ( NamedCache::Handle  hCache,
Filter::View  vFilter,
bool  fCacheValues = false,
MapListener::Handle  hListener = NULL,
ValueExtractor::View  vTransformer = NULL 
) [protected]

Create a materialized view of a NamedCache using a Filter.

A materialized view is an implementation of Continuous Query exposed through the standard NamedCache API. This constructor allows a client to receive all events, including those that result from the initial population of the ContinuousQueryCache. In other words, all contents of the ContinuousQueryCache will be delivered to the listener as a sequence of events, including those items that already exist in the underlying (unfiltered) cache.

Parameters:
hCache the NamedCache to create a view of
vFilter the Filter that defines the view
fCacheValues pass true to cache both the keys and values of the materialized view locally, or false to only cache the keys
hListener an initial MapListener that will receive all the events from the ContinuousQueryCache, including those corresponding to its initial population
vTransformer the transformer that should be used to convert values from the underlying cache before storing them locally


Member Function Documentation

virtual NamedCache::View getCache (  )  const [virtual]

Obtain the NamedCache that this ContinuousQueryCache is based on.

Returns:
the underlying NamedCache

virtual NamedCache::Handle getCache (  )  [virtual]

Obtain the NamedCache that this ContinuousQueryCache is based on.

Returns:
the underlying NamedCache

virtual Filter::View getFilter (  )  const [virtual]

Obtain the Filter that this ContinuousQueryCache is using to query the underlying NamedCache.

Returns:
the Filter that this cache uses to select its contents from the underlying NamedCache

virtual bool isCacheValues (  )  const [virtual]

Determine if this ContinuousQueryCache caches values locally.

Returns:
true if this object caches values locally, and false if it relies on the underlying NamedCache

virtual void setCacheValues ( bool  fCacheValues  )  [virtual]

Modify the local-caching option for the ContinuousQueryCache.

By changing this value from false to true, the ContinuousQueryCache will fully realize its contents locally and maintain them coherently in a manner analogous to the Coherence NearCache. By changing this value from true to false, the ContinuousQueryCache will discard its locally cached data and rely on the underlying NamedCache.

Parameters:
fCacheValues pass true to enable local caching, or false to disable it

virtual bool isReadOnly (  )  const [virtual]

Determine if this ContinuousQueryCache disallows data modification operations.

Returns:
true if this ContinuousQueryCache has been configured as read-only

virtual void setReadOnly ( bool  fReadOnly  )  [virtual]

Modify the read-only option for the ContinuousQueryCache.

Note that the cache can be made read-only, but the opposite (making it mutable) is explicitly disallowed.

Parameters:
fReadOnly pass true to prohibit clients from making modifications to this cache

virtual int32_t getState (  )  const [virtual]

Obtain the state of the ContinousQueryCache.

Returns:
one of the STATE_ enums

virtual int64_t getReconnectInterval (  )  const [virtual]

Return a reconnection interval (in milliseconds).

This value indicates how often the ContinuousQueryCache should attempt to re-connect with the underlying [clustered] cache in case the connection is severed.

Returns:
a reconnection interval (in milliseconds)

virtual void setReconnectInterval ( int64_t  cReconnectMillis  )  [virtual]

Specify a reconnection interval (in milliseconds).

This value indicates how often the ContinuousQueryCache should attempt to re-connect with the underlying [clustered] cache in case the connection is severed.

Parameters:
cReconnectMillis reconnection interval (in milliseconds). The value of zero means that the ContinuousQueryCache cannot be used when not connected. If the value is positive, the local content could be accessed (read-only) even if connection is severed.

virtual ObservableMap::Handle instantiateInternalCache (  )  [protected, virtual]

Create the internal cache used by the ContinuousQueryCache.

Returns:
a new ObservableMap that will represent the materialized view of the ContinuousQueryCache

virtual ObservableMap::View getInternalCache (  )  const [protected, virtual]

Obtain a reference to the internal cache.

The internal cache maintains all of the keys in the ContinuousQueryCache, and if isCacheValues()is true, it also maintains the up-to-date values corresponding to those keys.

Returns:
the internal cache that represents the materialized view of the ContinuousQueryCache

virtual ObservableMap::Handle getInternalCache (  )  [protected, virtual]

Obtain a reference to the internal cache.

The internal cache maintains all of the keys in the ContinuousQueryCache, and if isCacheValues()is true, it also maintains the up-to-date values corresponding to those keys.

Returns:
the internal cache that represents the materialized view of the ContinuousQueryCache

virtual bool isObserved (  )  const [protected, virtual]

Determine if the ContinuousQueryCache has any listeners that cannot be served by this Map listening to lite events.

Returns:
true iff there is at least one listener

virtual void setObserved ( bool  fObserved  )  [protected, virtual]

Specify whether the ContinuousQueryCache has any listeners that cannot be served by this Map listening to lite events.

Parameters:
fObserved true iff there is at least one listener

virtual void changeState ( int32_t  nState  )  const [protected, virtual]

Change the state of the ContinousQueryCache.

Parameters:
nState one of the STATE_ enums

virtual Filter::View mergeFilter ( Filter::View  vFilter  )  const [protected, virtual]

Return a filter which merges the ContinousQueueCache's filter with the supplied filter.

Parameters:
vFilter the filter to merge with this cache's filter
Returns:
the merged filter

virtual void checkReadOnly (  )  const [protected, virtual]

Check the read-only setting to verify that the cache is NOT read-only.

Exceptions:
IllegalStateException if the ContinuousQueryCache is read-only

virtual void checkEntry ( Map::Entry::View  vEntry  )  [protected, virtual]

Check the passed value to verify that it does belong in this ContinuousQueryCache.

Parameters:
vEntry a key value pair to check.
Exceptions:
IllegalArgumentException if the entry does not belong in this ContinuousQueryCache (based on the cache's filter)

virtual void checkEntry ( Object::View  vKey,
Object::Holder  ohValue 
) [protected, virtual]

Check the passed value to verify that it does belong in this ContinuousQueryCache.

Parameters:
vKey the key for the entry
ohValue the value for the entry
Exceptions:
IllegalArgumentException if the entry does not belong in this ContinuousQueryCache (based on the cache's filter)

virtual void configureSynchronization ( bool  fReload  )  const [protected, virtual]

Set up the listeners that keep the ContinuousQueryCache up-to-date.

Parameters:
fReload pass true to force a data reload

virtual Filter::View createTransformerFilter ( MapEventFilter::View  vFilterAdd  )  const [protected, virtual]

Wrap specified MapEventFilter with a MapEventTransformerFilter that will either transform cache value using transformer defined for this ContinuousQueryCache, or remove the old value from the event using SemiLiteEventTransformer, if no transformer is defined for this CQC.

Parameters:
filterAdd add filter to wrap
Returns:
MapEventTransformerFilter that wraps specified add filter
Since:
Coherence 12.1.2

virtual void ensureSynchronized ( bool  fReload  )  const [protected, virtual]

Ensure that the ContinousQueryCache listeners have been registered and its content synchronized with the underlying NamedCache.

Parameters:
fReload the value to pass to the configureSynchronization method if the ContinousQueryCache needs to be configured and synchronized

virtual bool isEventDeferred ( Object::View  vKey  )  const [protected, virtual]

Called when an event has occurred.

Allows the key to be logged as requiring deferred synchronization if the event occurs during the configuration or population of the ContinuousQueryCache.

Parameters:
vKey the key that the event is related to
Returns:
true if the event processing has been deferred

virtual bool removeBlind ( Object::View  vKey  )  [protected, virtual]

Removes the mapping for this key from this map if present.

This method exists to allow sub-classes to optmiize remove functionalitly for situations in which the original value is not required.

Parameters:
vKey key whose mapping is to be removed from the map
Returns:
true iff the Map changed as the result of this operation

virtual Set::View getInternalKeySet (  )  const [protected, virtual]

Obtain a set of keys that are represented by this Map.

Returns:
an internal Set of keys that are contained by this Map

virtual NamedCache::Handle getCacheInternal (  )  const [protected, virtual]

Return the underlying cache.

Returns:
the underlying cache

virtual MapListener::Handle instantiateAddListener (  )  const [protected, virtual]

Factory Method: Instantiate a MapListener for adding items to the query, and (if there are listeners on the ContinuousQueryCache) for dispatching inserts and updates.

Returns:
a new MapListener that will add items to and update items in the ContinuousQueryCache

virtual MapListener::Handle instantiateRemoveListener (  )  const [protected, virtual]

Factory Method: Instantiate a MapListener for evicting items from the query.

Returns:
a new MapListener that will listen to all events that will remove items from the ContinuousQueryCache

virtual void registerServiceListener (  )  const [protected, virtual]

Instantiate and register a MemberListener with the underlying caches's service.

The primary goal of that listener is invalidation of the front map in case of the service [automatic] restart.

virtual MultiplexingMapListener::Handle instantiateEventRouter ( MapListener::Handle  hListener  )  [protected, virtual]

Factory Method: Instantiate a listener on the internal map that will direct events to the passed listener, either synchronously or asynchronously as appropriate.

Parameters:
hListener the listener to route to
Returns:
a new EventRouter specific to the passed listener

virtual TaskDaemon::Handle instantiateEventQueue (  )  [protected, virtual]

Create a self-processing event queue.

Returns:
a QueueProcessor onto which events can be placed in order to be dispatched asynchronously

virtual TaskDaemon::Handle getEventQueue (  )  [protected, virtual]

Obtain this ContinuousQueryCache's event queue.

Returns:
the event queue that this ContinuousQueryCache uses to dispatch its events to its non-synchronous listeners

virtual TaskDaemon::Handle ensureEventQueue (  )  [protected, virtual]

Obtain the existing event queue or create one if none exists.

Returns:
the event queue that this ContinuousQueryCache uses to dispatch its events to its non-synchronous listeners

virtual Set::Handle instantiateKeySet (  )  [protected, virtual]

Create a new key set.

Returns:
the new key set

virtual Set::Handle instantiateEntrySet (  )  [protected, virtual]

Create a new EntrySet.

Returns:
the new empty set

virtual Map::Handle ensureIndexMap (  )  [protected, virtual]

Ensure that the map of indexes maintained by this cache exists.

Returns:
the map of indexes.

virtual Map::View getIndexMap (  )  const [protected, virtual]

Get the map of indexes maintained by this cache.

Returns:
the map of indexes.

virtual Map::Handle getIndexMap (  )  [protected, virtual]

Get the map of indexes maintained by this cache.

Returns:
the map of indexes.


Member Data Documentation

const int32_t state_disconnected [static]

State: Disconnected state.

The content of the ContinousQueryCache is not fully synchronized with the underlying [clustered] cache. If the value of the ReconnectInterval property is zero, it must be configured (synchronized) before it can be used.

FinalView<String> f_vsName [protected]

The name of the underlying NamedCache.

A copy is kept here because the reference to the underlying NamedCache is discarded when this cache is released.

Volatile<int32_t> m_nState [mutable, protected]

State of the ContinousQueryCache.

One of the STATE_* enums.

FinalHandle<Map> f_hMapIndex [protected]

The map of indexes maintained by this cache.

The keys of the Map are ValueExtractor objects, and for each key, the corresponding value stored in the Map is a MapIndex object.


The documentation for this class was generated from the following file:
Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.