GemFire 5.8

com.gemstone.gemfire.cache
Class RegionFactory

java.lang.Object
  extended by com.gemstone.gemfire.cache.RegionFactory

public class RegionFactory
extends Object

RegionFactory is a factory that encapsulates the following four steps to simplify Region creation.

  1. Connecting to a DistributedSystem
  2. Creation of a Cache
  3. Instantiation and configuration of RegionAttributes using a AttributesFactory
  4. Creation of a Region using the Cache
RegionFactory simplifies these steps into one class and potentially one step:
 final Region portfolios = new RegionFactory().setScope(Scope.DISTRIBUTED_ACK)
                           .setCacheLoader(new PortfolioDBLoader())
                           .setValueConstraint(Portfolio.class).setKeyConstraint(Integer.class)
                           .create("Portfolios");

 
or if you already have a Region that has many simimlar attributes to the one you would like to create, you can do this:

      final Region persistentPortfolios = new RegionFactory(portfolios.getAttributes())
                                          .setDiskDirs(new File[] {new File("/stor1/port1.persist"),
                                                                   new File("/stor2/port2.persis")})
                                          .setDiskWriteAttributes(new new DiskWriteAttributes())
                                          .create("Portfolios");
 
or you can refer to a collection of attributes already defined in a cache.xml file:
 final Region lruToDiskPortfolios = new RegionFactory("persistent")
                                    .create("Portfolios");
 
Where persistent is defined in a cache.xml file in this way:
      <region-attributes id="persistent" persist-backup="true" mirror-type="keys-values">
        <disk-write-attributes>
           <asynchronous-writes bytes-threshold="1000" time-interval="30"/>
         </disk-write-attributes>
         <eviction-attributes>
            <lru-entry-count maximum="1000" action="overflow-to-disk"/>
         </eviction-attributes>
      </region-attributes>
 

Since:
5.0
See Also:
DistributedSystem.connect(java.util.Properties), CacheFactory.create(com.gemstone.gemfire.distributed.DistributedSystem), AttributesFactory.create(), Cache.createRegion(java.lang.String, com.gemstone.gemfire.cache.RegionAttributes)

Constructor Summary
RegionFactory()
          Constructs a RegionFactory by creating a DistributedSystem and a Cache.
RegionFactory(Properties distributedSystemProperties)
          Constructs a RegionFactory by creating a DistributedSystem and a Cache.
RegionFactory(Properties distributedSystemProperties, RegionAttributes regionAttributes)
          Constructs a RegionFactory by creating a DistributedSystem and a Cache.
RegionFactory(Properties distributedSystemProperties, String regionAttributesId)
          Constructs a RegionFactory by creating a DistributedSystem and a Cache.
RegionFactory(RegionAttributes regionAttributes)
          Constructs a RegionFactory by creating a DistributedSystem and a Cache.
RegionFactory(String regionAttributesId)
          Constructs a RegionFactory by creating a DistributedSystem and a Cache.
 
Method Summary
 RegionFactory addCacheListener(CacheListener aListener)
          Adds a cache listener to the end of the list of cache listeners on this factory.
 Region create(String name)
          Creates a region using a DistributedSystem, Cache, and the configuration contained in this RegionFactory.
 RegionFactory initCacheListeners(CacheListener[] newListeners)
          Removes all cache listeners and then adds each listener in the specified array.
 RegionFactory setCacheLoader(CacheLoader cacheLoader)
          Sets the cache loader for the next RegionAttributes created.
 RegionFactory setCacheWriter(CacheWriter cacheWriter)
          Sets the cache writer for the next RegionAttributes created.
 RegionFactory setConcurrencyLevel(int concurrencyLevel)
          Sets the concurrency level tof the next RegionAttributes created.
 RegionFactory setCustomEntryIdleTimeout(CustomExpiry custom)
          Sets the custom idleTimeout for the next RegionAttributes created.
 RegionFactory setCustomEntryTimeToLive(CustomExpiry custom)
          Sets the custom timeToLive expiration method for the next RegionAttributes created.
 RegionFactory setDataPolicy(DataPolicy dataPolicy)
          Sets the data policy for the next RegionAttributes created.
 RegionFactory setDiskDirs(File[] diskDirs)
          Sets the directories to which the region's data are written.
 RegionFactory setDiskDirsAndSizes(File[] diskDirs, int[] diskSizes)
          Sets the directories to which the region's data are written and also set their sizes in megabytes
 RegionFactory setDiskWriteAttributes(DiskWriteAttributes attrs)
          Returns whether or not disk writes are asynchronous.
 RegionFactory setEarlyAck(boolean earlyAck)
          Sets for this region whether or not acks are sent after an update is processed.
 RegionFactory setEnableAsyncConflation(boolean value)
          Sets whether or not conflation is enabled for sending messages to async peers.
 RegionFactory setEnableBridgeConflation(boolean value)
          Deprecated. as of 5.7, use setEnableSubscriptionConflation(boolean)
 RegionFactory setEnableConflation(boolean value)
          Deprecated. as of 5.0, use setEnableSubscriptionConflation(boolean)
 RegionFactory setEnableGateway(boolean value)
          Sets whether or not updates are sent to defined Gateways.
 RegionFactory setEnableSubscriptionConflation(boolean value)
          Deprecated. as of 5.7, use setEnableSubscriptionConflation(boolean)
 RegionFactory setEnableWAN(boolean value)
          Deprecated. as of 5.0, use setEnableGateway(boolean)
 RegionFactory setEntryIdleTimeout(ExpirationAttributes idleTimeout)
          Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created.
 RegionFactory setEntryTimeToLive(ExpirationAttributes timeToLive)
          Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created.
 RegionFactory setEvictionAttributes(EvictionAttributes evictionAttributes)
          Sets the eviction attributes that controls growth of the Region to be created.
 RegionFactory setGatewayHubId(String id)
          Sets the id of the GatewayHub to which this region sends events.
 RegionFactory setIgnoreJTA(boolean flag)
          Sets whether operations on this region should be controlled by JTA transactions or not
 RegionFactory setIndexMaintenanceSynchronous(boolean synchronous)
          Sets how indexes on this region are kept current.
 RegionFactory setInitialCapacity(int initialCapacity)
          Sets the entry initial capacity for the next RegionAttributes created.
 RegionFactory setKeyConstraint(Class keyConstraint)
          Sets the key constraint for the next RegionAttributes created.
 RegionFactory setLoadFactor(float loadFactor)
          Sets the entry load factor for the next RegionAttributes created.
 RegionFactory setLockGrantor(boolean isLockGrantor)
          Sets whether this region should become lock grantor.
 RegionFactory setMembershipAttributes(MembershipAttributes ra)
          Sets the MembershipAttributes that describe the membership roles required for reliable access to the region.
 RegionFactory setMulticastEnabled(boolean value)
          Sets whether distributed operations on this region should attempt to use multicast.
 RegionFactory setPartitionAttributes(PartitionAttributes partition)
          Sets the PartitionAttributes that describe how the region is partitioned among members of the distributed system.
 RegionFactory setPoolName(String poolName)
          Sets the pool name attribute.
 void setPublisher(boolean v)
          Sets whether or not this region should be considered a publisher.
 RegionFactory setRegionIdleTimeout(ExpirationAttributes idleTimeout)
          Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created.
 RegionFactory setRegionTimeToLive(ExpirationAttributes timeToLive)
          Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created.
 RegionFactory setScope(Scope scopeType)
          Sets the scope for the next RegionAttributes created.
 RegionFactory setStatisticsEnabled(boolean statisticsEnabled)
          Sets whether statistics are enabled for this region and its entries.
 RegionFactory setSubscriptionAttributes(SubscriptionAttributes sa)
          Sets the kind of interest this region has in events occuring in other caches that define the region by the same name.
 RegionFactory setValueConstraint(Class valueConstraint)
          Sets the value constraint for the next RegionAttributes created.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegionFactory

public RegionFactory()
              throws CacheWriterException,
                     RegionExistsException,
                     TimeoutException,
                     ClientNotReadyException
Constructs a RegionFactory by creating a DistributedSystem and a Cache. If no DistributedSystem exists it creates a DistributedSystem with default configuration, otherwise it uses the existing DistributedSystem. The default Region configuration is used.

Throws:
CacheException - if unable to connect the DistributedSystem or create a Cache
CacheWriterException
RegionExistsException
TimeoutException
ClientNotReadyException

RegionFactory

public RegionFactory(RegionAttributes regionAttributes)
              throws CacheWriterException,
                     RegionExistsException,
                     TimeoutException,
                     ClientNotReadyException
Constructs a RegionFactory by creating a DistributedSystem and a Cache. If no DistributedSystem exists it creates a DistributedSystem with default configuration, otherwise it uses the existing DistributedSystem. The Region configuration is initialized using the provided RegionAttributes.

Throws:
CacheException - if unable to connect the DistributedSystem or create a Cache
CacheWriterException
RegionExistsException
TimeoutException
ClientNotReadyException

RegionFactory

public RegionFactory(String regionAttributesId)
              throws CacheWriterException,
                     RegionExistsException,
                     TimeoutException,
                     ClientNotReadyException
Constructs a RegionFactory by creating a DistributedSystem and a Cache. If no DistributedSystem exists it creates a DistributedSystem with default configuration, otherwise it uses the existing DistributedSystem. The Region configuration is initialized using the RegionAttributes identified in the cache.xml file by the provided identifier.

Parameters:
regionAttributesId - that identifies a set of RegionAttributes in the cache-xml file.
Throws:
IllegalArgumentException - if there are no attributes associated with the id
CacheException - if unable to connect the DistributedSystem or create a Cache
CacheWriterException
RegionExistsException
TimeoutException
ClientNotReadyException
See Also:
Cache.getRegionAttributes(java.lang.String)

RegionFactory

public RegionFactory(Properties distributedSystemProperties)
              throws CacheWriterException,
                     RegionExistsException,
                     TimeoutException,
                     ClientNotReadyException
Constructs a RegionFactory by creating a DistributedSystem and a Cache. If a DistributedSystem already exists with the same properties it uses that DistributedSystem, otherwise a DistributedSystem is created using the provided properties. The default Region configuration is used.

Parameters:
distributedSystemProperties - an instance of Properties containing DistributedSystemThrows:
CacheException - if unable to connect the DistributedSystem or create a Cache
CacheWriterException
RegionExistsException
TimeoutException
ClientNotReadyException

RegionFactory

public RegionFactory(Properties distributedSystemProperties,
                     RegionAttributes regionAttributes)
              throws CacheWriterException,
                     RegionExistsException,
                     TimeoutException,
                     ClientNotReadyException
Constructs a RegionFactory by creating a DistributedSystem and a Cache. If a DistributedSystem already exists with the same properties it uses that DistributedSystem, otherwise a DistributedSystem is created using the provided properties. The initial Region configuration is set using the RegionAttributes provided.

Parameters:
distributedSystemProperties - properties used to either find or create a DistributedSystem.
regionAttributes - the initial Region configuration for this RegionFactory.
Throws:
CacheException - if unable to connect the DistributedSystem or create a Cache
CacheWriterException
RegionExistsException
TimeoutException
ClientNotReadyException

RegionFactory

public RegionFactory(Properties distributedSystemProperties,
                     String regionAttributesId)
              throws CacheWriterException,
                     RegionExistsException,
                     TimeoutException,
                     ClientNotReadyException
Constructs a RegionFactory by creating a DistributedSystem and a Cache. If a DistributedSystem already exists whose properties match those provied, it uses that DistributedSystem. The Region configuration is initialized using the RegionAttributes identified in the cache.xml file by the provided identifier.

Parameters:
distributedSystemProperties - properties used to either find or create a DistributedSystem.
regionAttributesId - the identifier for set of RegionAttributes in the cache.xml file used as the initial Region configuration for this RegionFactory.
Throws:
IllegalArgumentException - if there are no attributes associated with the id
CacheException - if unable to connect the DistributedSystem or create a Cache
CacheWriterException
RegionExistsException
TimeoutException
ClientNotReadyException
Method Detail

setCacheLoader

public RegionFactory setCacheLoader(CacheLoader cacheLoader)
Sets the cache loader for the next RegionAttributes created.

Parameters:
cacheLoader - the cache loader or null if no loader
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setCacheLoader(com.gemstone.gemfire.cache.CacheLoader)

setCacheWriter

public RegionFactory setCacheWriter(CacheWriter cacheWriter)
Sets the cache writer for the next RegionAttributes created.

Parameters:
cacheWriter - the cache writer or null if no cache writer
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setCacheWriter(com.gemstone.gemfire.cache.CacheWriter)

addCacheListener

public RegionFactory addCacheListener(CacheListener aListener)
Adds a cache listener to the end of the list of cache listeners on this factory.

Parameters:
aListener - the cache listener to add
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if aListener is null
See Also:
AttributesFactory.addCacheListener(com.gemstone.gemfire.cache.CacheListener)

initCacheListeners

public RegionFactory initCacheListeners(CacheListener[] newListeners)
Removes all cache listeners and then adds each listener in the specified array. for the next RegionAttributes created.

Parameters:
newListeners - a possibly null or empty array of listeners to add to this factory.
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if the newListeners array has a null element
See Also:
AttributesFactory.initCacheListeners(com.gemstone.gemfire.cache.CacheListener[])

setEvictionAttributes

public RegionFactory setEvictionAttributes(EvictionAttributes evictionAttributes)
Sets the eviction attributes that controls growth of the Region to be created.

Parameters:
evictionAttributes - for the Region to create
Returns:
a reference to this RegionFactory object

setEntryIdleTimeout

public RegionFactory setEntryIdleTimeout(ExpirationAttributes idleTimeout)
Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created.

Parameters:
idleTimeout - the idleTimeout ExpirationAttributes for entries in this region
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if idleTimeout is null
See Also:
AttributesFactory.setEntryIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes)

setCustomEntryIdleTimeout

public RegionFactory setCustomEntryIdleTimeout(CustomExpiry custom)
Sets the custom idleTimeout for the next RegionAttributes created.

Parameters:
custom - the custom method
Returns:
the receiver
See Also:
AttributesFactory.setCustomEntryIdleTimeout(CustomExpiry)

setEntryTimeToLive

public RegionFactory setEntryTimeToLive(ExpirationAttributes timeToLive)
Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created.

Parameters:
timeToLive - the timeToLive ExpirationAttributes for entries in this region
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if timeToLive is null
See Also:
AttributesFactory.setEntryTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes)

setCustomEntryTimeToLive

public RegionFactory setCustomEntryTimeToLive(CustomExpiry custom)
Sets the custom timeToLive expiration method for the next RegionAttributes created.

Parameters:
custom - the custom method
Returns:
the receiver
See Also:
AttributesFactory.setCustomEntryTimeToLive(CustomExpiry)

setRegionIdleTimeout

public RegionFactory setRegionIdleTimeout(ExpirationAttributes idleTimeout)
Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created.

Parameters:
idleTimeout - the ExpirationAttributes for this region idleTimeout
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if idleTimeout is null
See Also:
AttributesFactory.setRegionIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes)

setRegionTimeToLive

public RegionFactory setRegionTimeToLive(ExpirationAttributes timeToLive)
Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created.

Parameters:
timeToLive - the ExpirationAttributes for this region timeToLive
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if timeToLive is null
See Also:
AttributesFactory.setRegionTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes)

setScope

public RegionFactory setScope(Scope scopeType)
Sets the scope for the next RegionAttributes created.

Parameters:
scopeType - the type of Scope to use for the region
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if scopeType is null
See Also:
AttributesFactory.setScope(com.gemstone.gemfire.cache.Scope)

setDataPolicy

public RegionFactory setDataPolicy(DataPolicy dataPolicy)
Sets the data policy for the next RegionAttributes created.

Parameters:
dataPolicy - The type of mirroring to use for the region
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if dataPolicy is null
See Also:
AttributesFactory.setDataPolicy(com.gemstone.gemfire.cache.DataPolicy)

setEarlyAck

public RegionFactory setEarlyAck(boolean earlyAck)
Sets for this region whether or not acks are sent after an update is processed.

Parameters:
earlyAck - set to true for the acknowledgement to be sent prior to processing the update
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setEarlyAck(boolean)

setMulticastEnabled

public RegionFactory setMulticastEnabled(boolean value)
Sets whether distributed operations on this region should attempt to use multicast.

Parameters:
value - true to enable multicast
Returns:
a reference to this RegionFactory object
Since:
5.0
See Also:
AttributesFactory.setMulticastEnabled(boolean)

setPoolName

public RegionFactory setPoolName(String poolName)
Sets the pool name attribute. This causes regions that use these attributes to be a client region which communicates with the servers that the connection pool communicates with.

If this attribute is set to null or "" then the connection pool is disabled causing regions that use these attributes to be communicate with peers instead of servers.

The named connection pool must exist on the cache at the time these attributes are used to create a region. See PoolManager.createFactory() for how to create a connection pool.

Parameters:
poolName - the name of the connection pool to use; if null or "" then the connection pool attribute is disabled for regions using these attributes.
Returns:
a reference to this RegionFactory object
Throws:
IllegalStateException - if a cache loader or cache writer has already been set.
Since:
5.7

setEnableWAN

public RegionFactory setEnableWAN(boolean value)
Deprecated. as of 5.0, use setEnableGateway(boolean)

Sets whether or not updates are sent to defined Gateways.

Parameters:
value - true to enable Gateway
Returns:
a reference to this RegionFactory object

setEnableGateway

public RegionFactory setEnableGateway(boolean value)
Sets whether or not updates are sent to defined Gateways.

Parameters:
value - true to enable Gateway
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setEnableGateway(boolean)

setPublisher

public void setPublisher(boolean v)
Sets whether or not this region should be considered a publisher.

Since:
5.0

setEnableAsyncConflation

public RegionFactory setEnableAsyncConflation(boolean value)
Sets whether or not conflation is enabled for sending messages to async peers.

Parameters:
value - true to enable async conflation
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setEnableAsyncConflation(boolean)

setEnableConflation

public RegionFactory setEnableConflation(boolean value)
Deprecated. as of 5.0, use setEnableSubscriptionConflation(boolean)

Sets whether or not conflation is enabled for sending messages from a cache server to its clients.

Parameters:
value - true to enable bridge conflation
Returns:
a reference to this RegionFactory object

setEnableBridgeConflation

public RegionFactory setEnableBridgeConflation(boolean value)
Deprecated. as of 5.7, use setEnableSubscriptionConflation(boolean)

Sets whether or not conflation is enabled for sending messages from a cache server to its clients.

Parameters:
value - true to enable bridge conflation
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setEnableBridgeConflation(boolean)

setEnableSubscriptionConflation

public RegionFactory setEnableSubscriptionConflation(boolean value)
Deprecated. as of 5.7, use setEnableSubscriptionConflation(boolean)

Sets whether or not conflation is enabled for sending messages from a cache server to its clients.

Parameters:
value - true to enable subscription conflation
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setEnableSubscriptionConflation(boolean)

setKeyConstraint

public RegionFactory setKeyConstraint(Class keyConstraint)
Sets the key constraint for the next RegionAttributes created. Keys in the region will be constrained to this class (or subclass). Any attempt to store a key of an incompatible type in the region will cause a ClassCastException to be thrown.

Parameters:
keyConstraint - The Class to constrain the keys to, or null if no constraint
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if keyConstraint is a class denoting a primitive type
See Also:
AttributesFactory.setKeyConstraint(java.lang.Class)

setValueConstraint

public RegionFactory setValueConstraint(Class valueConstraint)
Sets the value constraint for the next RegionAttributes created. Values in the region will be constrained to this class (or subclass). Any attempt to store a value of an incompatible type in the region will cause a ClassCastException to be thrown.

Parameters:
valueConstraint - The Class to constrain the values to, or null if no constraint
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if valueConstraint is a class denoting a primitive type
See Also:
AttributesFactory.setValueConstraint(java.lang.Class)

setInitialCapacity

public RegionFactory setInitialCapacity(int initialCapacity)
Sets the entry initial capacity for the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
initialCapacity - the initial capacity of the entry map
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if initialCapacity is negative.
See Also:
HashMap, AttributesFactory.setInitialCapacity(int)

setLoadFactor

public RegionFactory setLoadFactor(float loadFactor)
Sets the entry load factor for the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
loadFactor - the load factor of the entry map
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if loadFactor is nonpositive
See Also:
HashMap, AttributesFactory.setLoadFactor(float)

setConcurrencyLevel

public RegionFactory setConcurrencyLevel(int concurrencyLevel)
Sets the concurrency level tof the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
concurrencyLevel - the concurrency level of the entry map
Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if concurrencyLevel is nonpositive
See Also:
AttributesFactory.setConcurrencyLevel(int)

setDiskWriteAttributes

public RegionFactory setDiskWriteAttributes(DiskWriteAttributes attrs)
Returns whether or not disk writes are asynchronous.

Returns:
a reference to this RegionFactory object
See Also:
Region.writeToDisk(), AttributesFactory.setDiskWriteAttributes(com.gemstone.gemfire.cache.DiskWriteAttributes)

setDiskDirs

public RegionFactory setDiskDirs(File[] diskDirs)
Sets the directories to which the region's data are written. If multiple directories are used, GemFire will attempt to distribute the data evenly amongst them.

Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if a directory does not exist
See Also:
AttributesFactory.setDiskDirs(java.io.File[])

setDiskDirsAndSizes

public RegionFactory setDiskDirsAndSizes(File[] diskDirs,
                                         int[] diskSizes)
Sets the directories to which the region's data are written and also set their sizes in megabytes

Returns:
a reference to this RegionFactory object
Throws:
IllegalArgumentException - if a dir does not exist or the length of the size array does not match to the length of the dir array
Since:
5.1
See Also:
AttributesFactory.setDiskDirsAndSizes(java.io.File[], int[])

setPartitionAttributes

public RegionFactory setPartitionAttributes(PartitionAttributes partition)
Sets the PartitionAttributes that describe how the region is partitioned among members of the distributed system.

Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setPartitionAttributes(com.gemstone.gemfire.cache.PartitionAttributes)

setMembershipAttributes

public RegionFactory setMembershipAttributes(MembershipAttributes ra)
Sets the MembershipAttributes that describe the membership roles required for reliable access to the region.

Parameters:
ra - the MembershipAttributes to use
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setMembershipAttributes(com.gemstone.gemfire.cache.MembershipAttributes)

setIndexMaintenanceSynchronous

public RegionFactory setIndexMaintenanceSynchronous(boolean synchronous)
Sets how indexes on this region are kept current.

Parameters:
synchronous - whether indexes are maintained in a synchronized fashion
Returns:
a reference to this RegionFactory object

setStatisticsEnabled

public RegionFactory setStatisticsEnabled(boolean statisticsEnabled)
Sets whether statistics are enabled for this region and its entries.

Parameters:
statisticsEnabled - whether statistics are enabled
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setStatisticsEnabled(boolean)

setIgnoreJTA

public RegionFactory setIgnoreJTA(boolean flag)
Sets whether operations on this region should be controlled by JTA transactions or not

Since:
5.0

setLockGrantor

public RegionFactory setLockGrantor(boolean isLockGrantor)
Sets whether this region should become lock grantor.

Parameters:
isLockGrantor - whether this region should become lock grantor
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setLockGrantor(boolean)

setSubscriptionAttributes

public RegionFactory setSubscriptionAttributes(SubscriptionAttributes sa)
Sets the kind of interest this region has in events occuring in other caches that define the region by the same name.

Parameters:
sa - the attributes decribing the interest
Returns:
a reference to this RegionFactory object
See Also:
AttributesFactory.setSubscriptionAttributes(SubscriptionAttributes)

setGatewayHubId

public RegionFactory setGatewayHubId(String id)
Sets the id of the GatewayHub to which this region sends events.

Parameters:
id - the id of the GatewayHub
Returns:
a reference to this RegionFactory object
Since:
5.1
See Also:
AttributesFactory.setGatewayHubId(String)
Note: Early Access. Please consult GemStone technical support for assistance with this functionality.

create

public Region create(String name)
              throws CacheExistsException,
                     RegionExistsException,
                     CacheWriterException,
                     TimeoutException,
                     ClientNotReadyException
Creates a region using a DistributedSystem, Cache, and the configuration contained in this RegionFactory. Validation of the provided attributes may cause exceptions to be thrown if there are problems with the configuration data.

Parameters:
name - the name of the region to create
Returns:
the region object
Throws:
LeaseExpiredException - if lease expired on distributed lock for Scope.GLOBAL
RegionExistsException - if a region, shared or unshared, is already in this cache
TimeoutException - if timed out getting distributed lock for Scope.GLOBAL
CacheClosedException - if the cache is closed
IllegalStateException - if the supplied RegionAttributes is incompatible with this region in another cache in the distributed system (see AttributesFactory for compatibility rules)
CacheExistsException
CacheWriterException
ClientNotReadyException
See Also:
Cache.createRegion(java.lang.String, com.gemstone.gemfire.cache.RegionAttributes)

GemFire 5.8

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