|
GemFire 5.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Cache
Caches are obtained from static methods on the CacheFactory class.
When a cache is created a DistributedSystem must be specified.
This system tells the cache where to find other caches on the network
and how to communicate with them.
The system can also specify a
"cache-xml-file"
property which will cause this cache to be initialized with the contents
of that file. The contents must comply with the
"doc-files/cache5_0.dtd" file.
When a cache will no longer be used it should be closed.
Once it is closed any attempt to use it or any Region
obtained from it will cause a CacheClosedException to be thrown.
A cache can have multiple root regions, each with a different name.
AttributesMutator| Method Summary | |
|---|---|
BridgeServer |
addBridgeServer()
Deprecated. as of 5.7 use addCacheServer() instead. |
CacheServer |
addCacheServer()
Creates a new cache server, with the default configuration, that will allow clients to access this cache. |
GatewayHub |
addGatewayHub(String id,
int port)
Creates a new GatewayHub with the default configuration
and adds it to the collection of GatewayHubs. |
void |
close()
Terminates this object cache and releases all the resources. |
void |
close(boolean keepalive)
Terminates this object cache and releases all the resources. |
Region |
createRegion(String name,
RegionAttributes aRegionAttributes)
Creates a region using the specified RegionAttributes. |
Region |
createVMRegion(String name,
RegionAttributes aRegionAttributes)
Deprecated. as of GemFire 5.0, use createRegion(java.lang.String, com.gemstone.gemfire.cache.RegionAttributes) instead. |
List |
getBridgeServers()
Deprecated. as of 5.7 use getCacheServers() instead. |
List |
getCacheServers()
Returns a collection of all of the CacheServers
that can serve the contents of this Cache to clients. |
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 that this cache was created with. |
GatewayHub |
getGatewayHub()
Deprecated. as of GemFire 5.1, use getGatewayHubs().get(0) instead. |
GatewayHub |
getGatewayHub(String id)
Returns a GatewayHub with the given id. |
List |
getGatewayHubs()
Returns a list of all of the GatewayHubs. |
Context |
getJNDIContext()
Returns the JNDI context associated with the Cache. |
int |
getLockLease()
Gets the length, in seconds, of distributed lock leases obtained by this cache. |
int |
getLockTimeout()
Gets the number of seconds a cache operation will wait to obtain a distributed lock lease. |
LogWriter |
getLogger()
Gets the logging object for GemFire. |
int |
getMessageSyncInterval()
Gets the frequency (in seconds) at which a message will be sent by the primary cache-server to all the secondary cache-server nodes to remove the events which have already been dispatched from the queue. |
String |
getName()
Returns the name of this cache. |
QueryService |
getQueryService()
Return the QueryService for this cache. |
Region |
getRegion(String path)
Return the existing region (or subregion) with the specified path that already exists or is already mapped into the cache. |
RegionAttributes |
getRegionAttributes(String id)
Returns the RegionAttributes with the given
id or null if no
RegionAttributes with that id exists. |
int |
getSearchTimeout()
Gets the number of seconds a cache get operation
can spend searching for a value before it times out. |
LogWriter |
getSecurityLogger()
Gets the security logging object for GemFire. |
boolean |
isClosed()
Indicates if this cache has been closed. |
boolean |
isServer()
Returns whether or not this cache resides in a "cache server" VM. |
Map |
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 |
readyForEvents()
Notifies the server that this client is ready to receive updates. |
Set |
rootRegions()
Returns unmodifiable set of root regions in the cache. |
void |
setCopyOnRead(boolean copyOnRead)
Sets the "copy on read" feature for Cache read operations. |
GatewayHub |
setGatewayHub(String id,
int port)
Deprecated. as of GemFire 5.1, use addGatewayHub(java.lang.String, int) instead. |
void |
setIsServer(boolean isServer)
Sets whether or not this Cache resides in a
long-running "cache server" VM. |
void |
setLockLease(int seconds)
Sets the length, in seconds, of distributed lock leases obtained by this cache. |
void |
setLockTimeout(int seconds)
Sets the number of seconds a cache operation may wait to obtain a distributed lock lease before timing out. |
void |
setMessageSyncInterval(int seconds)
Sets the frequency (in seconds) at which a message will be sent by the primary cache-server node to all the secondary cache-server nodes to remove the events which have already been dispatched from the queue. |
void |
setRegionAttributes(String id,
RegionAttributes attrs)
Sets the id of the given
RegionAttributes. |
void |
setSearchTimeout(int seconds)
Sets the number of seconds a cache get operation can spend searching for a value. |
| Method Detail |
|---|
String getName()
CacheClosedException if the cache is closed.
boolean isClosed()
CacheClosedException
if the cache is closed.
DistributedSystem getDistributedSystem()
created with. This method does not throw
CacheClosedException if the cache is closed.
QueryService getQueryService()
Pool.getQueryService()void close()
Region.close() on each region in the cache.
After this cache is closed, any further
method call on this cache or any region object will throw
CacheClosedException, unless otherwise noted.
CacheClosedException - if the cache is already closed.void close(boolean keepalive)
Region.close() on each region in the cache.
After this cache is closed, any further
method call on this cache or any region object will throw
CacheClosedException, unless otherwise noted.
keepalive - whether the server should keep the durable client's queues alive for the timeout period
CacheClosedException - if the cache is already closed.
Region createVMRegion(String name,
RegionAttributes aRegionAttributes)
throws RegionExistsException,
TimeoutException
createRegion(java.lang.String, com.gemstone.gemfire.cache.RegionAttributes) instead.
name - the name of the region to createaRegionAttributes - the attributes of the root region
RegionExistsException - if a region is already in
this cache
LeaseExpiredException - if lease expired on distributed lock for Scope.GLOBAL
TimeoutException - if timed out getting distributed lock for Scope.GLOBAL
CacheClosedException - if the cache is closed
IllegalStateException - If the supplied RegionAttributes violate the
region creation constraints
with a region of the same name in another cache in the distributed system
Region createRegion(String name,
RegionAttributes aRegionAttributes)
throws RegionExistsException,
TimeoutException
name - the name of the region to createaRegionAttributes - the attributes of the root region
RegionExistsException - if a region is already in this cache
LeaseExpiredException - if lease expired on distributed lock for Scope.GLOBAL
TimeoutException - if timed out getting distributed lock for Scope.GLOBAL
CacheClosedException - if the cache is closed
IllegalStateException - If the supplied RegionAttributes violate the
region creation constraints
with a region of the same name in another cache in the distributed systemRegion getRegion(String path)
path - the path to the region
IllegalArgumentException - if path is null, the empty string, or "/"Set rootRegions()
LogWriter getLogger()
CacheClosedException if the cache is closed.
LogWriter getSecurityLogger()
CacheClosedException if the cache is closed.
int getLockTimeout()
CacheClosedException if the cache is closed.
void setLockTimeout(int seconds)
IllegalArgumentException - if seconds is less than zeroint getMessageSyncInterval()
void setMessageSyncInterval(int seconds)
seconds - -
the time interval in seconds
IllegalArgumentException - if seconds is less than zeroint getLockLease()
CacheClosedException if the cache is closed.
void setLockLease(int seconds)
IllegalArgumentException - if seconds is less than zero.int getSearchTimeout()
get operation
can spend searching for a value before it times out.
The search includes any time spent loading the object.
When the search times out it causes the get to fail by throwing
an exception.
This method does not throw
CacheClosedException if the cache is closed.
void setSearchTimeout(int seconds)
IllegalArgumentException - if seconds is less than zeroBridgeServer addBridgeServer()
addCacheServer() instead.
BridgeLoader,
BridgeWriterCacheServer addCacheServer()
For the default configuration see the constants in
CacheServer.
com.gemstone.gemfire.cache.serverList getBridgeServers()
getCacheServers() instead.
BridgeServers
that can serve the contents of this Cache.
Since 5.7 this method returns a ListCollection.
addBridgeServer()List getCacheServers()
CacheServers
that can serve the contents of this Cache to clients.
addCacheServer()
GatewayHub setGatewayHub(String id,
int port)
addGatewayHub(java.lang.String, int) instead.
GatewayHub with the default configuration.
id - The id of the GatewayHubport - The port of the GatewayHubGateway
GatewayHub addGatewayHub(String id,
int port)
GatewayHub with the default configuration
and adds it to the collection of GatewayHubs.
id - The id of the GatewayHubport - The port of the GatewayHubGatewayGatewayHub getGatewayHub()
getGatewayHubs().get(0) instead.
GatewayHub.
GatewayList getGatewayHubs()
GatewayHubs.
addGatewayHub(java.lang.String, int)GatewayHub getGatewayHub(String id)
GatewayHub with the given id.
id - The id of the GatewayHubaddGatewayHub(java.lang.String, int)void setIsServer(boolean isServer)
Cache resides in a
long-running "cache server" VM. A cache server may be an
application VM or may be a stand-along VM launched using the
GemFire Console, administration API, or the cacheserver command line
utility.
boolean isServer()
setIsServer(boolean)CacheTransactionManager getCacheTransactionManager()
CacheClosedException - if the cache is closed.void setCopyOnRead(boolean copyOnRead)
boolean getCopyOnRead()
Context getJNDIContext()
RegionAttributes getRegionAttributes(String id)
RegionAttributes with the given
id or null if no
RegionAttributes with that id exists.
setRegionAttributes(java.lang.String, com.gemstone.gemfire.cache.RegionAttributes)
void setRegionAttributes(String id,
RegionAttributes 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)Map listRegionAttributes()
Strings and the values of the map are
RegionAttributes.
void 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.
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
RegionExistsExceptionvoid readyForEvents()
|
GemFire 5.7.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||