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


Detailed Description

A factory class that must be used to obtain instances of Cache.

To create a new cache instance, use CacheFactory.Create.

To get an existing unclosed cache instance, use CacheFactory.GetInstance.

An instance of DistributedSystem is required to obtain a cache instance from this factory. Because DistributedSystem only allows a single instance of itself per process, you can only have a single open cache, per process.

Static Public Member Functions

static CacheCreate (String^ name, DistributedSystem^ system, String^ cacheXml, CacheAttributes^ attributes)
static CacheCreate (String^ name, DistributedSystem^ system, CacheAttributes^ attributes)
static CacheCreate (String^ name, DistributedSystem^ system, String^ cacheXml)
static CacheCreate (String^ name, DistributedSystem^ system)
static CacheGetAnyInstance ()
static CacheGetInstance (DistributedSystem^ system)
static CacheGetInstanceCloseOk (DistributedSystem^ system)

Properties

static String^  ProductDescription [get]
static String^  Version [get]


Member Function Documentation

static Cache ^ GemStone::GemFire::Cache::CacheFactory::Create ( String^   name,
DistributedSystem^   system,
String^   cacheXml,
CacheAttributes^   attributes 
) [static]

Creates a new cache using the specified system using parameters from the given XML file and with the given CacheAttributes.

Parameters:
name the name to associate with the new cache
system a DistributedSystem obtained by calling DistributedSystem.Connect
cacheXml name of the cache configuration XML file
attributes 
optional CacheAttributes for this cache; these override the ones provided in cacheXml.

Returns:
a Cache that uses the specified DistributedSystem for distribution.
Exceptions:
IllegalArgumentException If system is not DistributedSystem.IsConnected or name is null
CacheExistsException ff an open cache already exists
CacheXmlException if something went wrong while parsing the XML
IllegalStateException if the XML file is well-formed but not valid (consistent)

static Cache ^ GemStone::GemFire::Cache::CacheFactory::Create ( String^   name,
DistributedSystem^   system,
CacheAttributes^   attributes 
) [static]

Creates a new cache using the specified system using the given CacheAttributes.

Parameters:
name the name to associate with the new cache
system a DistributedSystem obtained by calling DistributedSystem.Connect
attributes 
optional CacheAttributes for this cache

Returns:
a Cache that uses the specified DistributedSystem for distribution.
Exceptions:
IllegalArgumentException If system is not DistributedSystem.IsConnected or name is null
CacheExistsException ff an open cache already exists

static Cache ^ GemStone::GemFire::Cache::CacheFactory::Create ( String^   name,
DistributedSystem^   system,
String^   cacheXml 
) [static]

Creates a new cache using the specified system using parameters from the given XML file.

Parameters:
name the name to associate with the new cache
system a DistributedSystem obtained by calling DistributedSystem.Connect
cacheXml name of the cache configuration XML file
Returns:
a Cache that uses the specified DistributedSystem for distribution.
Exceptions:
IllegalArgumentException If system is not DistributedSystem.IsConnected or name is null
CacheExistsException ff an open cache already exists
CacheXmlException if something went wrong while parsing the XML
IllegalStateException if the XML file is well-formed but not valid (consistent)

static Cache ^ GemStone::GemFire::Cache::CacheFactory::Create ( String^   name,
DistributedSystem^   system 
) [static]

Creates a new cache using the specified system.

Parameters:
name the name to associate with the new cache
system a DistributedSystem obtained by calling DistributedSystem.Connect
Returns:
a Cache that uses the specified DistributedSystem for distribution.
Exceptions:
IllegalArgumentException If system is not connected ( DistributedSystem.IsConnected ) or name is null.
CacheExistsException If an open cache already exists.

static Cache ^ GemStone::GemFire::Cache::CacheFactory::GetAnyInstance (  )  [static]

Gets an arbitrary open instance of Cache produced by an earlier call to CacheFactory.Create.

Exceptions:
CacheClosedException if a cache has not been created or the only created one is closed ( Cache.IsClosed )
EntryNotFoundException if a cache with specified system not found

static Cache ^ GemStone::GemFire::Cache::CacheFactory::GetInstance ( DistributedSystem^   system  )  [static]

Gets the instance of Cache produced by an earlier call to CacheFactory.Create.

Parameters:
system the DistributedSystem the cache was created with.
Returns:
the Cache associated with the specified system.
Exceptions:
IllegalArgumentException if the distributed system argument is null
CacheClosedException if a cache has not been created or the created one is closed ( Cache.IsClosed )
EntryNotFoundException if a cache with specified system not found

static Cache ^ GemStone::GemFire::Cache::CacheFactory::GetInstanceCloseOk ( DistributedSystem^   system  )  [static]

Gets the instance of Cache produced by an earlier call to CacheFactory.Create, even if it has been closed.

Parameters:
system the DistributedSystem the cache was created with.
Returns:
the Cache associated with the specified system.
Exceptions:
IllegalArgumentException if the distributed system argument is null
CacheClosedException if a cache has not been created.
EntryNotFoundException if a cache with specified system not found


Property Documentation

String^ GemStone::GemFire::Cache::CacheFactory::ProductDescription [static, get]

Returns the product description string including product name and version.

String^ GemStone::GemFire::Cache::CacheFactory::Version [static, get]

Returns the version of the cache implementation. For the 1.0 release of GemFire, the string returned is 1.0.

Returns:
the version of the cache implementation as a String


GemFire C++ Cache .NET API Documentation