|
GemFire 5.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gemstone.gemfire.cache.CacheFactory
public class CacheFactory
A factory class that must be used to obtain instances of Cache.
To create a new cache instance use create(com.gemstone.gemfire.distributed.DistributedSystem).
To get the existing unclosed cache instance use getInstance(com.gemstone.gemfire.distributed.DistributedSystem).
An instance of DistributedSystem is required to obtain a cache
instance from this factory. Because DistributedSystem only
allows a single instance of itself per VM, you can only have
a single open cache, per VM.
| Method Summary | |
|---|---|
static Cache |
create(DistributedSystem system)
Creates a new cache that uses the specified system. |
static Cache |
getAnyInstance()
Gets an arbitrary open instance of Cache produced by an
earlier call to create(com.gemstone.gemfire.distributed.DistributedSystem). |
static Cache |
getInstance(DistributedSystem system)
Gets the instance of Cache produced by an
earlier call to create(com.gemstone.gemfire.distributed.DistributedSystem). |
static Cache |
getInstanceCloseOk(DistributedSystem system)
Gets the instance of Cache produced by an
earlier call to create(com.gemstone.gemfire.distributed.DistributedSystem) even if it has been closed. |
static String |
getVersion()
Returns the version of the cache implementation. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Cache create(DistributedSystem system)
throws CacheExistsException,
TimeoutException,
CacheWriterException,
GatewayException,
RegionExistsException
system.
The system can specify a "cache-xml-file"
property which will cause this creation to also create the
regions, objects, and attributes declared in the file. The
contents of the file must comply with the
"doc-files/cache5_0.dtd"> file.
Note that when parsing the XML file Declarable classes
are loaded using the current thread's context class loader.
system - a DistributedSystem obtained by calling
DistributedSystem.connect(java.util.Properties).
Cache that uses the specified
system for distribution.
IllegalArgumentException - If system is not connected.
CacheExistsException - If an open cache already exists.
CacheXmlException - If a problem occurs while parsing the declarative caching
XML file.
TimeoutException - If a Region.put(Object, Object) times out while initializing the
cache.
CacheWriterException - If a CacheWriterException is thrown while
initializing the cache.
GatewayException - If a GatewayException is thrown while
initializing the cache.
RegionExistsException - If the declarative caching XML file desribes a region
that already exists (including the root region).public static Cache getInstance(DistributedSystem system)
Cache produced by an
earlier call to create(com.gemstone.gemfire.distributed.DistributedSystem).
system - the DistributedSystem the cache was created with.
Cache associated with the specified system.
CacheClosedException - if a cache has not been created
or the created one is closedpublic static Cache getInstanceCloseOk(DistributedSystem system)
Cache produced by an
earlier call to create(com.gemstone.gemfire.distributed.DistributedSystem) even if it has been closed.
system - the DistributedSystem the cache was created with.
Cache associated with the specified system.
CacheClosedException - if a cache has not been createdpublic static Cache getAnyInstance()
Cache produced by an
earlier call to create(com.gemstone.gemfire.distributed.DistributedSystem).
CacheClosedException - if a cache has not been created
or the only created one is closedpublic static String getVersion()
"3.0".
String
|
GemFire 5.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||