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

Inherits GemStone::GemFire::Cache::Generic::IGemFireCache, and GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Cache >.


Detailed Description

Provides a distributed cache.

Caches are obtained from Create methods on the CacheFactory.Create class.

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

virtual void Close (bool keepalive)
virtual void Close ()
IRegionServiceCreateAuthenticatedView (Properties< String^ , Object^ >^credentials, String^ poolName)
IRegionServiceCreateAuthenticatedView (Properties< String^ , Object^ >^credentials)
virtual
IPdxInstanceFactory
CreatePdxInstanceFactory (String^ className)
template<class TKey, class TValue>
virtual IRegion
< TKey, TValue >^ 
CreateRegion (String^ name, Generic::RegionAttributes< TKey, TValue >^attributes)
RegionFactoryCreateRegionFactory (RegionShortcut regionShortcut)
virtual bool GetPdxIgnoreUnreadFields ()
 summary> Returns whether PdxInstance is preferred for PDX types instead of .NET object.
template<class TKey, class TResult>
virtual
Generic::QueryService
< TKey, TResult >^ 
GetQueryService (String^ poolName)
template<class TKey, class TResult>
virtual
Generic::QueryService
< TKey, TResult >^ 
GetQueryService ()
template<class TKey, class TValue>
virtual IRegion
< TKey, TValue >^ 
GetRegion (String^ path)
virtual void InitializeDeclarativeCache (String^ cacheXml)
virtual void ReadyForEvents ()
template<class TKey, class TValue>
virtual array
< IRegion< TKey,
TValue >^>^ 
RootRegions ()

Properties

virtual
GemStone::GemFire::Cache::Generic::CacheTransactionManager^  
CacheTransactionManager [get]
virtual
GemStone::GemFire::Cache::Generic::DistributedSystem^  
DistributedSystem [get]
virtual bool IsClosed [get]
virtual String^  Name [get]


Member Function Documentation

virtual void GemStone::GemFire::Cache::Generic::Cache::Close ( bool  keepalive  )  [virtual]

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.

virtual void GemStone::GemFire::Cache::Generic::Cache::Close (  )  [virtual]

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.

Implements GemStone::GemFire::Cache::Generic::IRegionService.

IRegionService ^ GemStone::GemFire::Cache::Generic::Cache::CreateAuthenticatedView ( Properties< String^ , Object^ >^  credentials,
String^   poolName 
)

Returns the instance of IRegionService to do the operation on Cache with different Credential.

Deafault pool should be in multiuser mode CacheFactory.SetMultiuserAuthentication

Parameters:
credentials the user Credentials.
poolName Pool, which is in multiuser mode.
Returns:
Instance of IRegionService
summary> Returns whether Cache saves unread fields for Pdx types. /summary>

IRegionService ^ GemStone::GemFire::Cache::Generic::Cache::CreateAuthenticatedView ( Properties< String^ , Object^ >^  credentials  ) 

Returns the instance of IRegionService to do the operation on Cache with different Credential.

Deafault pool should be in multiuser mode CacheFactory.SetMultiuserAuthentication

Parameters:
credentials the user Credentials.
Returns:
Instance of IRegionService

virtual IPdxInstanceFactory ^ GemStone::GemFire::Cache::Generic::Cache::CreatePdxInstanceFactory ( String^   className  )  [virtual]

Returns a factory that can create a PdxInstance.

Parameters:
className the fully qualified class name that the PdxInstance will become when it is fully deserialized.
Returns:
the factory

Implements GemStone::GemFire::Cache::Generic::IRegionService.

template<class TKey, class TValue>
virtual IRegion<TKey, TValue> ^ GemStone::GemFire::Cache::Generic::Cache::CreateRegion ( String^   name,
Generic::RegionAttributes< TKey, TValue >^  attributes 
) [explicit, virtual]

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.

If Pool attached with Region is in multiusersecure mode then don't use return instance of region as no credential are attached with this instance. Get instance of region from <see cref="Cache.CreateAuthenticatedView" to do the operation on Cache.

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
<deprecated> as of NativeClient 3.5, use <see cref="Cache.CreateRegionFactory /> instead. </deprecated>

RegionFactory ^ GemStone::GemFire::Cache::Generic::Cache::CreateRegionFactory ( RegionShortcut  regionShortcut  ) 

Returns the instance of RegionFactory to create the region

Pass the RegionShortcut to set the deafult region attributes

Parameters:
regionShortcut the regionShortcut to set the default region attributes
Returns:
Instance of RegionFactory

virtual bool GemStone::GemFire::Cache::Generic::Cache::GetPdxIgnoreUnreadFields (  )  [virtual]

summary> Returns whether PdxInstance is preferred for PDX types instead of .NET object.

/summary>

Implements GemStone::GemFire::Cache::Generic::IGemFireCache.

template<class TKey, class TResult>
virtual Generic::QueryService<TKey, TResult> ^ GemStone::GemFire::Cache::Generic::Cache::GetQueryService ( String^   poolName  )  [explicit, virtual]

Get a query service object to be able to query the cache. Use only when Cache has more than one Pool.

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.

template<class TKey, class TResult>
virtual Generic::QueryService<TKey, TResult> ^ GemStone::GemFire::Cache::Generic::Cache::GetQueryService (  )  [explicit, virtual]

Get a query service object to be able to query the cache. Supported only when cache is created from Pool(pool is in multiuserSecure mode)

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.

Implements GemStone::GemFire::Cache::Generic::IRegionService.

template<class TKey, class TValue>
virtual IRegion<TKey, TValue> ^ GemStone::GemFire::Cache::Generic::Cache::GetRegion ( String^   path  )  [explicit, virtual]

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

If Pool attached with Region is in multiusersecure mode then don't use return instance of region as no credential are attached with this instance. Get region from RegionService instance of Cache.Cache.CreateAuthenticatedView(PropertiesPtr).

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

Implements GemStone::GemFire::Cache::Generic::IRegionService.

virtual void GemStone::GemFire::Cache::Generic::Cache::InitializeDeclarativeCache ( String^   cacheXml  )  [virtual]

Initializes the cache from an XML file.

Parameters:
cacheXml pathname of a cache.xml file

Implements GemStone::GemFire::Cache::Generic::IGemFireCache.

virtual void GemStone::GemFire::Cache::Generic::Cache::ReadyForEvents (  )  [virtual]

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.

template<class TKey, class TValue>
virtual array<IRegion<TKey, TValue>^> ^ GemStone::GemFire::Cache::Generic::Cache::RootRegions (  )  [explicit, virtual]

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

It is not supported when Cache is created from Pool.

Returns:
array of regions

Implements GemStone::GemFire::Cache::Generic::IRegionService.


Property Documentation

virtual GemStone:: GemFire:: Cache:: Generic:: CacheTransactionManager^ GemStone::GemFire::Cache::Generic::Cache::CacheTransactionManager [get]

Returns the cache transaction manager of CacheFactory.Create this cache.

Implements GemStone::GemFire::Cache::Generic::IGemFireCache.

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

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

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

Implements GemStone::GemFire::Cache::Generic::IGemFireCache.

virtual bool GemStone::GemFire::Cache::Generic::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

Implements GemStone::GemFire::Cache::Generic::IRegionService.

virtual String^ GemStone::GemFire::Cache::Generic::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

Implements GemStone::GemFire::Cache::Generic::IGemFireCache.


GemFire C++ Cache .NET API Documentation