Oracle Coherence for C++ API
Release 3.6.0.0

E15728-01

CacheService Class Reference

#include <coherence/net/CacheService.hpp>

Inherits Service.

List of all members.


Detailed Description

A CacheService is a clustered service providing a collection of named Maps that hold resources shared among members of a cluster.

These resources are expected to be managed in memory, and are typically composed of data that are also stored persistently in a database, or data that have been assembled or calculated at some significant cost, thus these resources are referred to as cached.

Author:
jh 2007.12.21

Public Types

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

Public Member Functions

virtual
NamedCache::Handle 
ensureCache (String::View vsName)=0
 Obtain a NamedCache interface that provides a view of resources shared among members of a cluster.
virtual Collection::View getCacheNames () const =0
 Returns a Collection of String objects, one for each cache name that has been previously registered with this CacheService.
virtual void releaseCache (NamedCache::Handle hMap)=0
 Release local resources associated with the specified instance of the cache.
virtual void destroyCache (NamedCache::Handle hMap)=0
 Release and destroy the specified cache.

Member Function Documentation

virtual NamedCache::Handle ensureCache ( String::View  vsName  )  [pure virtual]

Obtain a NamedCache interface that provides a view of resources shared among members of a cluster.

The view is identified by name within this CacheService. Typically, repeated calls to this method with the same view name and class loader instance will result in the same view reference being returned.

Parameters:
vsName the name, within this CacheService, that uniquely identifies a view; null is legal, and may imply a default name
Returns:
a NamedCache interface which can be used to access the resources of the specified view
Exceptions:
IllegalStateException thrown if the service is not running

virtual Collection::View getCacheNames (  )  const [pure virtual]

Returns a Collection of String objects, one for each cache name that has been previously registered with this CacheService.

Returns:
a Collection of cache names
Exceptions:
IllegalStateException thrown if the CacheService is not running or has stopped

virtual void releaseCache ( NamedCache::Handle  hMap  )  [pure virtual]

Release local resources associated with the specified instance of the cache.

This invalidates a reference obtained by using the ensureCache(String::View) method.

Releasing a Map reference to a cache makes the Map reference 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.

The reference that is released using this method can no longer be used; any attempt to use the reference will result in an exception.

The purpose for releasing a cache reference is to allow the cache implementation to release resources.

Parameters:
hMap the cache object to be released
See also:
NamedCache::release()

virtual void destroyCache ( NamedCache::Handle  hMap  )  [pure virtual]

Release and destroy the specified cache.

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.

Parameters:
hMap the cache object to be released
See also:
NamedCache::destroy()


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