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

E77779-01

WrapperNamedCache Class Reference

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

Inherits Object, and NamedCache.

Inherited by BundlingNamedCache.

List of all members.


Detailed Description

A wrapper for the given NamedCache.

Author:
lh 2012.06.18
Since:
Coherence 12.1.2

Public Types

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

Public Member Functions

virtual size32_t size () const
 
virtual bool isEmpty () const
 
virtual bool containsKey (Object::View vKey) const
 
virtual bool containsValue (Object::View vValue) const
 
virtual Object::Holder get (Object::View vKey) const
 
virtual Object::Holder get (Object::View vKey)
 
virtual Object::Holder put (Object::View vKey, Object::Holder ohValue)
 
virtual Object::Holder remove (Object::View vKey)
 
virtual void putAll (Map::View vMap)
 
virtual void clear ()
 
virtual Set::View keySet () const
 
virtual Set::Handle keySet ()
 
virtual Collection::View values () const
 
virtual
Collection::Handle 
values ()
 
virtual Set::View entrySet () const
 
virtual Set::Handle entrySet ()
 
virtual Map::View getAll (Collection::View vKeys) const
 
virtual Object::Holder put (Object::View vKey, Object::Holder ohValue, int64_t cMillis)
 
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

virtual void truncate ()
 Removes all mappings from this map.

Note: the removal of entries caused by this truncate operation will not be observable. This includes any registered listeners, triggers, or interceptors. However, a CacheLifecycleEvent is raised to notify subscribers of the execution of this operation.

Exceptions:
UnsupportedOperationException if the server does not support the truncate operation

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

Returns:
the cache name

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

Returns:
true if the NamedCache is active; false otherwise

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

Returns:
the CacheService

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

Returns:
the CacheService

virtual bool lock (Object::View vKey, int64_t cWait) const
 
virtual bool lock (Object::View vKey) const
 
virtual bool unlock (Object::View vKey) const
 
virtual Object::Holder invoke (Object::View vKey, EntryProcessor::Handle hAgent)
 
virtual Map::View invokeAll (Collection::View vCollKeys, EntryProcessor::Handle hAgent)
 
virtual Map::View invokeAll (Filter::View vFilter, EntryProcessor::Handle hAgent)
 
virtual Object::Holder aggregate (Collection::View vCollKeys, EntryAggregator::Handle hAgent) const
 
virtual Object::Holder aggregate (Filter::View vFilter, EntryAggregator::Handle hAgent) const
 
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 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 TypedHandle
< const String
toString () const
 Output a human-readable description of this Object to the given stream.

Note that when overriding this method the return type must be TypedHandle<const String> rather then String::View. These two types are assignment compatible but not equivalent and declaring the override with String::View will not be a compatible override.

coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toString method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents and is generally how toString() will be implemented.

 Object::View vKey   = ...
 Object::View vValue = ...
 std::cout << vKey << " = " << vValue << std::endl;

 String::View vs = COH_TO_STRING(vKey << " = " << vValue);

The COH_TO_STRING macro is also the most common way to implement the toString method. For example:

 virtual TypedHandle<const String> Person::toString() const
     {
     return COH_TO_STRING("Name: " << f_sName << " SSN: " << f_nSSN);
     }

Returns:
a string representation of this object

virtual
NamedCache::Handle 
getNamedCache ()
 Get the actual (wrapped) named cache.
virtual NamedCache::View getNamedCache () const
 Get the actual (wrapped) named cache.

Protected Member Functions

 WrapperNamedCache (NamedCache::Handle hCache)
 Create a new WrapperNamedCache.

Protected Attributes

FinalHandle< NamedCachef_hNamedCache
 Actual (wrapped) NamedCache.

Constructor & Destructor Documentation

WrapperNamedCache ( NamedCache::Handle  hCache  )  [protected]

Create a new WrapperNamedCache.

Parameters:
hCache the NamedCache that will be wrapped by this WrapperNamedCache


Member Function Documentation

virtual NamedCache::Handle getNamedCache (  )  [virtual]

Get the actual (wrapped) named cache.

Returns:
the wrapped cache

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

Get the actual (wrapped) named cache.

Returns:
the wrapped cache


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