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(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
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 |
registerPdxMetaData(Object instance)
Registers PDX meta-data given an instance of a domain class that will be serialized
with PDX.
|
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 . |
close, createPdxEnum, createPdxInstanceFactory, getCancelCriterion, getJsonFormatter, getQueryService, getRegion, isClosed, rootRegions
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)
copyOnRead
- whether the "copy on read" feature should be enabledboolean getCopyOnRead()
<K,V> RegionAttributes<K,V> getRegionAttributes(String id)
RegionAttributes
with the given id
or null
if no
RegionAttributes
with that id exists.K
- the type of keys in the regionV
- the type of values in the regionid
- the id
of the RegionAttributes
RegionAttributes
with the given id
setRegionAttributes(java.lang.String, org.apache.geode.cache.RegionAttributes<K, V>)
<K,V> void setRegionAttributes(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.K
- the type of keys in the regionV
- the type of values in the regionid
- 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> Map<String,RegionAttributes<K,V>> listRegionAttributes()
String
s and the values of the map are RegionAttributes
.K
- the type of keys in the regionV
- the type of values in the regionvoid loadCacheXml(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
.
is
- the InputStream from which to read the XMLCacheXmlException
- 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
LogWriter getLogger()
CacheClosedException
if
the cache is closed.LogWriter getSecurityLogger()
CacheClosedException
if the cache is closed.DiskStore findDiskStore(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.null
if no disk store is foundDiskStoreFactory createDiskStoreFactory()
DiskStoreFactory
GatewaySenderFactory createGatewaySenderFactory()
boolean getPdxReadSerialized()
PdxInstance
is preferred for PDX types instead of Java object.PdxInstance
is preferred for PDX types instead of Java objectCacheFactory.setPdxReadSerialized(boolean)
,
ClientCacheFactory.setPdxReadSerialized(boolean)
PdxSerializer getPdxSerializer()
CacheFactory.setPdxSerializer(PdxSerializer)
,
ClientCacheFactory.setPdxSerializer(PdxSerializer)
String getPdxDiskStore()
CacheFactory.setPdxDiskStore(String)
,
ClientCacheFactory.setPdxDiskStore(String)
boolean getPdxPersistent()
CacheFactory.setPdxPersistent(boolean)
,
ClientCacheFactory.setPdxPersistent(boolean)
boolean getPdxIgnoreUnreadFields()
CacheFactory.setPdxIgnoreUnreadFields(boolean)
,
ClientCacheFactory.setPdxIgnoreUnreadFields(boolean)
void registerPdxMetaData(Object instance)
Note that this method serializes the given instance so PDX must already be configured to do the serialization.
Note that if the instance is not of a class that will be serialized with PDX then no meta-data is registered.
Note that in most cases this method never needs to be called. Currently it is only needed by the JdbcLoader when gets are done for JDBC data that was not written to the table using geode.
instance
- the instance of the domain class for which meta-data is to be registeredSerializationException
- if the instance can not be serialized or is not serialized with
PDXCacheTransactionManager getCacheTransactionManager()
CacheClosedException
- if the cache is closed.Context getJNDIContext()
Declarable getInitializer()
null
if it does not have an
initializer.Properties getInitializerProps()
null
if no
initializer properties exist.