public interface GemFireCache extends RegionService
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:
CacheFactory.create() creates a peer/server instance of Cache.
ClientCacheFactory.create() creates a client instance of ClientCache.
| Modifier and Type | Method and Description |
|---|---|
DiskStoreFactory |
createDiskStoreFactory()
create diskstore factory
|
GatewaySenderFactory |
createGatewaySenderFactory() |
DiskStore |
findDiskStore(java.lang.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. |
java.util.Properties |
getInitializerProps()
Returns the Properties used to initialize the cache initializer or
null if no initializer properties exist. |
javax.naming.Context |
getJNDIContext()
Returns the JNDI context associated with the Cache.
|
LogWriter |
getLogger()
Gets the logging object for GemFire.
|
java.lang.String |
getName()
Returns the name of this cache.
|
java.lang.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(java.lang.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> java.util.Map<java.lang.String,RegionAttributes<K,V>> |
listRegionAttributes()
Returns an unmodifiable mapping of ids to region attributes.
|
void |
loadCacheXml(java.io.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(java.lang.String id,
RegionAttributes<K,V> attrs)
Sets the
id of the given
RegionAttributes. |
close, createPdxEnum, createPdxInstanceFactory, getCancelCriterion, getQueryService, getRegion, isClosed, rootRegionsjava.lang.String getName()
CacheClosedException if the cache is closed.DistributedSystem getDistributedSystem()
CacheClosedException if the cache is closed.ResourceManager getResourceManager()
ResourceManager for managing this cache's
resources.ResourceManager for managing this cache's resourcesvoid setCopyOnRead(boolean copyOnRead)
boolean getCopyOnRead()
<K,V> RegionAttributes<K,V> getRegionAttributes(java.lang.String id)
RegionAttributes with the given
id or null if no
RegionAttributes with that id exists.setRegionAttributes(java.lang.String, org.apache.geode.cache.RegionAttributes<K, V>)<K,V> void setRegionAttributes(java.lang.String id,
RegionAttributes<K,V> attrs)
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.id - The id of the region attributesattrs - The attributes to associate with id. If
attrs is null, any existing
RegionAttributes associated with
id will be removed.getRegionAttributes(java.lang.String)<K,V> java.util.Map<java.lang.String,RegionAttributes<K,V>> listRegionAttributes()
Strings and the values of the map are
RegionAttributes.void loadCacheXml(java.io.InputStream is)
throws TimeoutException,
CacheWriterException,
GatewayException,
RegionExistsException
Because this method may perform a put on a
Region, it declares that it throws a
TimeoutException, CacheWriterException,
GatewayException,
or RegionExistsException.
CacheXmlException - If the XML read from is does not conform to
the dtd or if an IOException occurs while
reading the XML.TimeoutExceptionCacheWriterExceptionGatewayExceptionRegionExistsExceptionLogWriter getLogger()
CacheClosedException if the cache is closed.LogWriter getSecurityLogger()
CacheClosedException if the cache is closed.DiskStore findDiskStore(java.lang.String name)
null if no disk store is found.name - the name of the disk store to find. If null then the
default disk store, if it exists, is returned.DiskStoreFactory createDiskStoreFactory()
GatewaySenderFactory createGatewaySenderFactory()
boolean getPdxReadSerialized()
CacheFactory.setPdxReadSerialized(boolean),
ClientCacheFactory.setPdxReadSerialized(boolean)PdxSerializer getPdxSerializer()
CacheFactory.setPdxSerializer(PdxSerializer),
ClientCacheFactory.setPdxSerializer(PdxSerializer)java.lang.String getPdxDiskStore()
CacheFactory.setPdxDiskStore(String),
ClientCacheFactory.setPdxDiskStore(String)boolean getPdxPersistent()
CacheFactory.setPdxPersistent(boolean),
ClientCacheFactory.setPdxPersistent(boolean)boolean getPdxIgnoreUnreadFields()
CacheFactory.setPdxIgnoreUnreadFields(boolean),
ClientCacheFactory.setPdxIgnoreUnreadFields(boolean)CacheTransactionManager getCacheTransactionManager()
CacheClosedException - if the cache is closed.javax.naming.Context getJNDIContext()
Declarable getInitializer()
null
if it does not have an initializer.java.util.Properties getInitializerProps()
null if no initializer properties exist.