com.gemstone.gemfire.cache
Interface Cache

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.

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.

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.

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

isClosed

boolean isClosed()

Indicates if this cache has been closed.
After a new cache object is created, this method returns false;
After the close is called on this cache object, this method
returns true. This method does not throw CacheClosedException
if the cache is closed.

getQueryService

4.0
The Query operations performed using this QueryService instance
will be executed on the local cache.
Applications using client server topology and wanting to execute
queries on the server from the client should obtain the QueryService
instance from the Pool.

close

void close()

Terminates this object cache and releases all the resources.
Calls 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.

close

void close(boolean keepalive)

Terminates this object cache and releases all the resources.
Calls 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.

Parameters:

keepalive - whether the server should keep the durable client's queues alive for the timeout period

getRegion

Return the existing region (or subregion) with the specified
path that already exists or is already mapped into the cache.
Whether or not the path starts with a forward slash it is interpreted as a
full path starting at a root.

getMessageSyncInterval

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.

Returns:

The time interval in seconds

setMessageSyncInterval

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.

setLockLease

getSearchTimeout

int getSearchTimeout()

Gets the number of seconds a cache
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.

setSearchTimeout

void setSearchTimeout(int seconds)

Sets the number of seconds a cache get operation can spend searching
for a value.

getGatewayHub

Note: Early Access. Please consult GemStone technical support for assistance with this functionality.

setIsServer

void setIsServer(boolean isServer)

Sets whether or not this 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.

loadCacheXml

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.

readyForEvents

void readyForEvents()

Notifies the server that this client is ready to receive updates.
This method is used by durable clients to notify servers that they
are ready to receive updates. As soon as the server receives this message,
it will forward updates to this client (if necessary).