GemFire 6.5

com.gemstone.gemfire.cache
Interface RegionService

All Known Subinterfaces:
Cache, ClientCache, GemFireCache

public interface RegionService

A RegionService provides access to existing regions that exist in a GemFire cache. Regions can be obtained using getRegion(java.lang.String) and queried using getQueryService(). The service should be closed to free up resources once it is no longer needed. Once it is closed any attempt to use it or any regions obtained from it will cause a CacheClosedException to be thrown.

Instances of the interface are created using one of the following methods:

Since:
6.5

Method Summary
 void close()
          Terminates this region service and releases all its resources.
 CancelCriterion getCancelCriterion()
          the cancellation criterion for this service
 QueryService getQueryService()
          Return the QueryService for this region service.
<K,V> Region<K,V>
getRegion(String path)
          Return the existing region (or subregion) with the specified path.
 boolean isClosed()
          Indicates if this region service has been closed.
 Set<Region<?,?>> rootRegions()
          Returns unmodifiable set of the root regions that in the region service.
 

Method Detail

getCancelCriterion

CancelCriterion getCancelCriterion()
the cancellation criterion for this service

Returns:
the service's cancellation object

getRegion

<K,V> Region<K,V> getRegion(String path)
Return the existing region (or subregion) with the specified path. Whether or not the path starts with a forward slash it is interpreted as a full path starting at a root.

Parameters:
path - the path to the region
Returns:
the Region or null if not found
Throws:
IllegalArgumentException - if path is null, the empty string, or "/"

rootRegions

Set<Region<?,?>> rootRegions()
Returns unmodifiable set of the root regions that in the region service. This set is a snapshot; it is not backed by the region service.

Returns:
a Set of regions

getQueryService

QueryService getQueryService()
Return the QueryService for this region service. For a region service in a client the returned QueryService will execute queries on the server. For a region service not in a client the returned QueryService will execute queries on the local and peer regions.


close

void close()
Terminates this region service and releases all its resources. Calls Region.close() on each region in the service. After this service is closed, any further method calls on this service or any region object obtained from the service will throw CacheClosedException, unless otherwise noted.

Throws:
CacheClosedException - if the service is already closed.

isClosed

boolean isClosed()
Indicates if this region service has been closed. After a new service is created, this method returns false; After close is called on this service, this method returns true. This method does not throw CacheClosedException if the service is closed.

Returns:
true, if this service has just been created or has started to close; false, otherwise

GemFire 6.5

Copyright © 2002-2010 GemStone Systems, Inc. All Rights Reserved.