GemStone::GemFire::Cache::Cache Class Reference


Detailed Description

Provides a distributed cache.

Caches are obtained from static methods on the CacheFactory class.

When a cache is created a DistributedSystem must be specified.

When a cache will no longer be used, call Cache.Close. Once it Cache.IsClosed any attempt to use it will cause a CacheClosedException to be thrown.

A cache can have multiple root regions, each with a different name.

Public Member Functions

void Close (Boolean keepalive)
void Close ()
RegionCreateRegion (String^ name, RegionAttributes^ attributes)
void CreateServerRegion (String^ name, RegionAttributes^ attributes)
 This functionality is unsupported in the Native Client Product.
void DeregisterRegionListener ()
void DestroyServerRegion (String^ name)
 This functionality is unsupported in the Native Client Product.
QueryServiceGetQueryService ()
RegionGetRegion (String^ path)
RegionAttributesGetServerRegionAttributes (String^ path)
 This functionality is unsupported in the Native Client Product.
array< String^ >^ GetServerRegions (String^ parent)
 This functionality is unsupported in the Native Client Product.
void InitializeDeclarativeCache (String^ cacheXml)
void ReadyForEvents ()
void RegisterRegionListener (ICacheRegionListener^ listener)
array< Region^ >^ RootRegions ()
array< String^ >^ ServerRootRegions ()
 This functionality is unsupported in the Native Client Product.

Properties

DistributedSystem^  DistributedSystem [get]
Boolean IsClosed [get]
String^  Name [get]


Member Function Documentation

void GemStone::GemFire::Cache::Cache::Close ( Boolean  keepalive  ) 

Terminates this object cache and releases all the local resources.

After this cache is closed, any further method call on this cache or any region object will throw CacheClosedException, unless otherwise noted.

Parameters:
keepalive whether to keep a durable client's queue alive
Exceptions:
CacheClosedException if the cache is already closed.

void GemStone::GemFire::Cache::Cache::Close (  ) 

Terminates this object cache and releases all the local resources.

After this cache is closed, any further method call on this cache or any region object will throw CacheClosedException, unless otherwise noted.

Exceptions:
CacheClosedException if the cache is already closed.

Region ^ GemStone::GemFire::Cache::Cache::CreateRegion ( String^   name,
RegionAttributes^   attributes 
)

Creates a region with the given name using the specified RegionAttributes.

The region is just created locally. It is not created on the server to which this client is connected with.

Parameters:
name the name of the region to create
attributes the attributes of the root region
Returns:
new region
Exceptions:
RegionExistsException if a region with the same name is already in this cache
CacheClosedException if the cache is closed
OutOfMemoryException if the memory allocation failed
RegionCreationFailedException if the call fails due to incomplete mirror initialization
InitFailedException if the optional PersistenceManager fails to initialize
UnknownException otherwise

void GemStone::GemFire::Cache::Cache::CreateServerRegion ( String^   name,
RegionAttributes^   attributes 
)

This functionality is unsupported in the Native Client Product.

void GemStone::GemFire::Cache::Cache::DeregisterRegionListener (  ) 

Deregister the existing ICacheRegionListener.

void GemStone::GemFire::Cache::Cache::DestroyServerRegion ( String^   name  ) 

This functionality is unsupported in the Native Client Product.

QueryService ^ GemStone::GemFire::Cache::Cache::GetQueryService (  ) 

Get a query service object to be able to query the cache.

Currently only works against the java server in native mode, and at least some endpoints must have been defined in some regions before actually firing a query.

Region ^ GemStone::GemFire::Cache::Cache::GetRegion ( String^   path  ) 

Returns an existing region given the full path from root, or null if no such region exists.

Parameters:
path the pathname of the region
Returns:
the region

RegionAttributes ^ GemStone::GemFire::Cache::Cache::GetServerRegionAttributes ( String^   path  ) 

This functionality is unsupported in the Native Client Product.

array<String^> ^ GemStone::GemFire::Cache::Cache::GetServerRegions ( String^   parent  ) 

This functionality is unsupported in the Native Client Product.

void GemStone::GemFire::Cache::Cache::InitializeDeclarativeCache ( String^   cacheXml  ) 

Initializes the cache from an XML file.

Parameters:
cacheXml pathname of a cache.xml file

void GemStone::GemFire::Cache::Cache::ReadyForEvents (  ) 

Send the client-ready message to the server for a durable client.

This method should only be called for durable clients and with a cache server version 5.5 onwards.

Exceptions:
IllegalStateException if there was a problem sending the message to the server.

void GemStone::GemFire::Cache::Cache::RegisterRegionListener ( ICacheRegionListener^   listener  ) 

Register an ICacheRegionListener.

Only one ICacheRegionListener can be registered at a time. If a new ICacheRegionListener is registered on an existing one then the new one replaces the old one.

Parameters:
listener The ICacheRegionListener to be registered.

array<Region^> ^ GemStone::GemFire::Cache::Cache::RootRegions (  ) 

Returns an array of root regions in the cache. This set is a snapshot and is not backed by the cache.

Returns:
array of regions

array<String^> ^ GemStone::GemFire::Cache::Cache::ServerRootRegions (  ) 

This functionality is unsupported in the Native Client Product.


Property Documentation

DistributedSystem^ GemStone::GemFire::Cache::Cache::DistributedSystem [get]

Returns the distributed system used to CacheFactory.Create this cache.

This method does not throw CacheClosedException if the cache is closed.

Boolean GemStone::GemFire::Cache::Cache::IsClosed [get]

True if this cache has been closed.

After a new cache object is created, this method returns false. After Close is called on this cache object, this method returns true.

Returns:
true if this cache is closed, otherwise false

String^ GemStone::GemFire::Cache::Cache::Name [get]

Returns the name of this cache.

This method does not throw CacheClosedException if the cache is closed.

Returns:
the string name of this cache


GemFire C++ Cache .NET API Documentation