GemFire 6.6.4

com.gemstone.gemfire.cache
Interface GemFireCache

All Superinterfaces:
RegionService
All Known Subinterfaces:
Cache, ClientCache

public interface GemFireCache
extends RegionService

GemFireCache represents the singleton cache that must be created in order to use GemFire in a Java virtual machine. Users must create either a Cache for a peer/server JVM or a ClientCache for a client JVM. Instances of this interface are created using one of the following methods:

Since:
6.5

Method Summary
 DiskStoreFactory createDiskStoreFactory()
          create diskstore factory
 DiskStore findDiskStore(String name)
          Returns the DiskStore by name or null if no disk store is found.
 CacheTransactionManager getCacheTransactionManager()
          Get the CacheTransactionManager instance for this Cache.
 boolean getCopyOnRead()
          Indicates whether the "copy on read" is enabled for this cache.
 DistributedSystem getDistributedSystem()
          Returns the distributed system used by this cache.
 Declarable getInitializer()
          Returns the Declarable used to initialize this cache or null if it does not have an initializer.
 Properties getInitializerProps()
          Returns the Properties used to initialize the cache initializer or null if no initializer properties exist.
 Context getJNDIContext()
          Returns the JNDI context associated with the Cache.
 LogWriter getLogger()
          Gets the logging object for GemFire.
 String getName()
          Returns the name of this cache.
 String getPdxDiskStore()
          Returns the disk store used for PDX meta data
 boolean getPdxIgnoreUnreadFields()
          Returns true if fields that are not read during PDX deserialization should be ignored during the PDX serialization.
 boolean getPdxPersistent()
          Returns true if the PDX metadata for this cache is persistent
 boolean getPdxReadSerialized()
          Returns whether { @link PdxInstance} is preferred for PDX types instead of Java object.
 PdxSerializer getPdxSerializer()
          Returns the PdxSerializer used by this cache, or null if no PDX serializer is defined.
<K,V> RegionAttributes<K,V>
getRegionAttributes(String id)
          Returns the RegionAttributes with the given id or null if no RegionAttributes with that id exists.
 ResourceManager getResourceManager()
          Returns the ResourceManager for managing this cache's resources.
 LogWriter getSecurityLogger()
          Gets the security logging object for GemFire.
<K,V> Map<String,RegionAttributes<K,V>>
listRegionAttributes()
          Returns an unmodifiable mapping of ids to region attributes.
 void loadCacheXml(InputStream is)
          Loads the cache configuration described in a declarative caching XML file into this cache.
 void setCopyOnRead(boolean copyOnRead)
          Sets the "copy on read" feature for cache read operations.
<K,V> void
setRegionAttributes(String id, RegionAttributes<K,V> attrs)
          Sets the id of the given RegionAttributes.
 
Methods inherited from interface com.gemstone.gemfire.cache.RegionService
close, createPdxEnum, createPdxInstanceFactory, getCancelCriterion, getQueryService, getRegion, isClosed, rootRegions
 

Method Detail

getName

String getName()
Returns the name of this cache. This method does not throw CacheClosedException if the cache is closed.

Returns:
the String name of this cache

getDistributedSystem

DistributedSystem getDistributedSystem()
Returns the distributed system used by this cache. This method does not throw CacheClosedException if the cache is closed.


getResourceManager

ResourceManager getResourceManager()
Returns the ResourceManager for managing this cache's resources.

Returns:
ResourceManager for managing this cache's resources
Since:
6.0

setCopyOnRead

void setCopyOnRead(boolean copyOnRead)
Sets the "copy on read" feature for cache read operations.

Since:
4.0

getCopyOnRead

boolean getCopyOnRead()
Indicates whether the "copy on read" is enabled for this cache.

Returns:
true if "copy on read" is enabled, false otherwise.
Since:
4.0

getRegionAttributes

<K,V> RegionAttributes<K,V> getRegionAttributes(String id)
Returns the RegionAttributes with the given id or null if no RegionAttributes with that id exists.

Since:
4.1
See Also:
setRegionAttributes(java.lang.String, com.gemstone.gemfire.cache.RegionAttributes)

setRegionAttributes

<K,V> void setRegionAttributes(String id,
                               RegionAttributes<K,V> attrs)
Sets the id of the given RegionAttributes. If a region attributes named name already exists, the mapping will be overwritten with attrs. However, changing the mapping will not effect existing regions.

Parameters:
id - The id of the region attributes
attrs - The attributes to associate with id. If attrs is null, any existing RegionAttributes associated with id will be removed.
Since:
4.1
See Also:
getRegionAttributes(java.lang.String)

listRegionAttributes

<K,V> Map<String,RegionAttributes<K,V>> listRegionAttributes()
Returns an unmodifiable mapping of ids to region attributes. The keys of the map are Strings and the values of the map are RegionAttributes.

Since:
4.1

loadCacheXml

void loadCacheXml(InputStream is)
                  throws TimeoutException,
                         CacheWriterException,
                         GatewayException,
                         RegionExistsException
Loads the cache configuration described in a declarative caching XML file into this cache. If the XML describes a region that already exists, any mutable region attributes, indexes, and region entries that are defined in the XML are updated/added.

Because this method may perform a put on a Region, it declares that it throws a TimeoutException, CacheWriterException, GatewayException, or RegionExistsException.

Throws:
CacheXmlException - If the XML read from is does not conform to the dtd or if an IOException occurs while reading the XML.
TimeoutException
CacheWriterException
GatewayException
RegionExistsException
Since:
4.1

getLogger

LogWriter getLogger()
Gets the logging object for GemFire. This method does not throw CacheClosedException if the cache is closed.

Returns:
the logging object

getSecurityLogger

LogWriter getSecurityLogger()
Gets the security logging object for GemFire. This method does not throw CacheClosedException if the cache is closed.

Returns:
the security logging object

findDiskStore

DiskStore findDiskStore(String name)
Returns the DiskStore by name or null if no disk store is found.

Parameters:
name - the name of the disk store to find. If null then the default disk store, if it exists, is returned.
Since:
6.5

createDiskStoreFactory

DiskStoreFactory createDiskStoreFactory()
create diskstore factory

Since:
6.5

getPdxReadSerialized

boolean getPdxReadSerialized()
Returns whether { @link PdxInstance} is preferred for PDX types instead of Java object.

Since:
6.6
See Also:
CacheFactory.setPdxReadSerialized(boolean), ClientCacheFactory.setPdxReadSerialized(boolean)
Note: Early Access. Please consult GemStone technical support for assistance with this functionality.

getPdxSerializer

PdxSerializer getPdxSerializer()
Returns the PdxSerializer used by this cache, or null if no PDX serializer is defined.

Since:
6.6
See Also:
CacheFactory.setPdxSerializer(PdxSerializer), ClientCacheFactory.setPdxSerializer(PdxSerializer)

getPdxDiskStore

String getPdxDiskStore()
Returns the disk store used for PDX meta data

Since:
6.6
See Also:
CacheFactory.setPdxDiskStore(String), ClientCacheFactory.setPdxDiskStore(String)

getPdxPersistent

boolean getPdxPersistent()
Returns true if the PDX metadata for this cache is persistent

Since:
6.6
See Also:
CacheFactory.setPdxPersistent(boolean), ClientCacheFactory.setPdxPersistent(boolean)

getPdxIgnoreUnreadFields

boolean getPdxIgnoreUnreadFields()
Returns true if fields that are not read during PDX deserialization should be ignored during the PDX serialization.

Since:
6.6
See Also:
CacheFactory.setPdxIgnoreUnreadFields(boolean), ClientCacheFactory.setPdxIgnoreUnreadFields(boolean)

getCacheTransactionManager

CacheTransactionManager getCacheTransactionManager()
Get the CacheTransactionManager instance for this Cache.

Returns:
The CacheTransactionManager instance.
Throws:
CacheClosedException - if the cache is closed.
Since:
4.0

getJNDIContext

Context getJNDIContext()
Returns the JNDI context associated with the Cache.

Returns:
javax.naming.Context Added as part of providing JTA implementation in Gemfire.
Since:
4.0

getInitializer

Declarable getInitializer()
Returns the Declarable used to initialize this cache or null if it does not have an initializer.

Since:
6.6

getInitializerProps

Properties getInitializerProps()
Returns the Properties used to initialize the cache initializer or null if no initializer properties exist.

Since:
6.6

GemFire 6.6.4

Copyright © 1997-2012 VMware, Inc. All rights reserved.