RegionFactory (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.cache, class: RegionFactory

Package org.apache.geode.cache

# Class RegionFactory<K,V>

java.lang.Object
org.apache.geode.cache.RegionFactory<K,V>

public class RegionFactory<K,V> extends Object
`RegionFactory` is used to create `regions` in a `cache`. Instances of this interface can be created:

- using a `shortcut` by calling `Cache.createRegionFactory(RegionShortcut)` which will initialize the factory with the shortcut's region attributes
- using a named region attribute by calling `Cache.createRegionFactory(String)` which will initialize the factory the named region attributes
- using a region attribute instance by calling `Cache.createRegionFactory(RegionAttributes)` which will initialize the factory with the given region attributes
- by calling `Cache.createRegionFactory()` which will initialize the factory with defaults

Once the factory has been created it can be customized with its setter methods.

The final step is to produce a `Region` by calling `create(String)`.

Example: Create a replicate region with a CacheListener

     Cache c = new CacheFactory().create();
     // Create replicate region.
     // Add a cache listener before creating region
     Region r = c.createRegionFactory(REPLICATE).addCacheListener(myListener).create("replicate");

Example: Create a partition region that has redundancy

     Cache c = new CacheFactory().create();
     // Create replicate region.
     // Add a cache listener before creating region
     Region r = c.createRegionFactory(PARTITION_REDUNDANT).create("partition");

Since:
  GemFire 5.0

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `RegionFactory()`
  Deprecated.
  as of 6.5 use `Cache.createRegionFactory()` instead.
  ``
  `RegionFactory(String regionAttributesId)`
  Deprecated.
  as of 6.5 use `Cache.createRegionFactory(String)` instead.
  ``
  `RegionFactory(Properties distributedSystemProperties)`
  Deprecated.
  as of 6.5 use `CacheFactory(Properties)` and `Cache.createRegionFactory()` instead.
  ``
  `RegionFactory(Properties distributedSystemProperties, String regionAttributesId)`
  Deprecated.
  as of 6.5 use `CacheFactory(Properties)` and `Cache.createRegionFactory(String)` instead.
  ``
  `RegionFactory(Properties distributedSystemProperties, RegionAttributes<K,V> regionAttributes)`
  Deprecated.
  as of 6.5 use `CacheFactory(Properties)` and `Cache.createRegionFactory(RegionAttributes)` instead.
  ``
  `RegionFactory(RegionAttributes<K,V> regionAttributes)`
  Deprecated.
  as of 6.5 use `Cache.createRegionFactory(RegionAttributes)` instead.
  `protected`
  `RegionFactory(RegionFactory<K,V> regionFactory)`
  Constructs a RegionFactory that is a copy of an existing RegionFactory
  `protected`
  `RegionFactory(org.apache.geode.internal.cache.InternalCache cache)`
  For internal use only.
  `protected`
  `RegionFactory(org.apache.geode.internal.cache.InternalCache cache, String regionAttributesId)`
  For internal use only.
  `protected`
  `RegionFactory(org.apache.geode.internal.cache.InternalCache cache, RegionAttributes ra)`
  For internal use only.
  `protected`
  `RegionFactory(org.apache.geode.internal.cache.InternalCache cache, RegionShortcut pra)`
  For internal use only.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RegionFactory<K,V>`
  `addAsyncEventQueueId(String asyncEventQueueId)`
  Adds a asyncEventQueueId to the RegionAttributes
  `RegionFactory<K,V>`
  `addCacheListener(CacheListener<K,V> aListener)`
  Adds a cache listener to the end of the list of cache listeners on this factory.
  `RegionFactory<K,V>`
  `addGatewaySenderId(String gatewaySenderId)`
  Adds a gatewaySenderId to the RegionAttributes
  `Region<K,V>`
  `create(String name)`
  Creates a region with the given name in this factory's `Cache` using the configuration contained in this factory.
  `Region<K,V>`
  `createSubregion(Region<?,?> parent, String name)`
  Creates a sub-region in the `Cache` using the configuration contained in this RegionFactory.
  `protected org.apache.geode.internal.cache.InternalCache`
  `getCache()`
  Returns the cache used by this factory.
  `protected RegionAttributes<K,V>`
  `getRegionAttributes()`
  Returns the attributes used by this factory to create a region.
  `RegionFactory<K,V>`
  `initCacheListeners(CacheListener<K,V>[] newListeners)`
  Removes all cache listeners and then adds each listener in the specified array.
  `RegionFactory<K,V>`
  `setCacheLoader(CacheLoader<K,V> cacheLoader)`
  Sets the cache loader for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setCacheWriter(CacheWriter<K,V> cacheWriter)`
  Sets the cache writer for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setCloningEnabled(boolean cloningEnable)`
  Sets cloning on region Note: off-heap regions always behave as if cloning is enabled.
  `RegionFactory<K,V>`
  `setCompressor(Compressor compressor)`
  Set the compressor to be used by this region for compressing region entry values.
  `RegionFactory<K,V>`
  `setConcurrencyChecksEnabled(boolean enabled)`
  Enables a versioning system that detects concurrent modifications and ensures that region contents are consistent across the distributed system.
  `RegionFactory<K,V>`
  `setConcurrencyLevel(int concurrencyLevel)`
  Sets the concurrency level tof the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setCustomEntryIdleTimeout(CustomExpiry<K,V> custom)`
  Sets the custom idleTimeout for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setCustomEntryTimeToLive(CustomExpiry<K,V> custom)`
  Sets the custom timeToLive expiration method for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setDataPolicy(DataPolicy dataPolicy)`
  Sets the data policy for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setDiskDirs(File[] diskDirs)`
  Deprecated.
  as of 6.5 use `DiskStoreFactory.setDiskDirs(java.io.File[])` instead
  `RegionFactory<K,V>`
  `setDiskDirsAndSizes(File[] diskDirs, int[] diskSizes)`
  Deprecated.
  as of 6.5 use `DiskStoreFactory.setDiskDirsAndSizes(java.io.File[], int[])` instead
  `RegionFactory<K,V>`
  `setDiskStoreName(String name)`
  Sets the DiskStore name attribute.
  `RegionFactory<K,V>`
  `setDiskSynchronous(boolean isSynchronous)`
  Sets whether or not the writing to the disk is synchronous.
  `RegionFactory<K,V>`
  `setDiskWriteAttributes(DiskWriteAttributes attrs)`
  Deprecated.
  as of 6.5 use `setDiskStoreName(java.lang.String)` instead
  `RegionFactory<K,V>`
  `setEarlyAck(boolean earlyAck)`
  Deprecated.
  As of 6.5 this setting no longer has any effect.
  `RegionFactory<K,V>`
  `setEnableAsyncConflation(boolean value)`
  Sets whether or not conflation is enabled for sending messages to async peers.
  `RegionFactory<K,V>`
  `setEnableSubscriptionConflation(boolean value)`
  Sets whether or not conflation is enabled for sending messages from a cache server to its clients.
  `RegionFactory<K,V>`
  `setEntryIdleTimeout(ExpirationAttributes idleTimeout)`
  Sets the idleTimeout expiration attributes for region entries for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setEntryTimeToLive(ExpirationAttributes timeToLive)`
  Sets the timeToLive expiration attributes for region entries for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setEvictionAttributes(EvictionAttributes evictionAttributes)`
  Sets the eviction attributes that controls growth of the Region to be created.
  `RegionFactory<K,V>`
  `setIgnoreJTA(boolean flag)`
  Sets whether operations on this region should be controlled by JTA transactions or not
  `RegionFactory<K,V>`
  `setIndexMaintenanceSynchronous(boolean synchronous)`
  Sets how indexes on this region are kept current.
  `RegionFactory<K,V>`
  `setInitialCapacity(int initialCapacity)`
  Sets the entry initial capacity for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setKeyConstraint(Class<K> keyConstraint)`
  Sets the key constraint for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setLoadFactor(float loadFactor)`
  Sets the entry load factor for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setLockGrantor(boolean isLockGrantor)`
  Sets whether this region should become lock grantor.
  `RegionFactory<K,V>`
  `setMembershipAttributes(MembershipAttributes ra)`
  Deprecated.
  this API is scheduled to be removed
  `RegionFactory<K,V>`
  `setMulticastEnabled(boolean value)`
  Sets whether distributed operations on this region should attempt to use multicast.
  `RegionFactory<K,V>`
  `setOffHeap(boolean offHeap)`
  Enables this region's usage of off-heap memory if true.
  `RegionFactory<K,V>`
  `setPartitionAttributes(PartitionAttributes partition)`
  Sets the `PartitionAttributes` that describe how the region is partitioned among members of the distributed system.
  `RegionFactory<K,V>`
  `setPoolName(String poolName)`
  Sets the pool name attribute.
  `void`
  `setPublisher(boolean v)`
  Deprecated.
  as of 6.5
  `RegionFactory<K,V>`
  `setRegionIdleTimeout(ExpirationAttributes idleTimeout)`
  Sets the idleTimeout expiration attributes for the region itself for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setRegionTimeToLive(ExpirationAttributes timeToLive)`
  Sets the timeToLive expiration attributes for the region itself for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setScope(Scope scopeType)`
  Sets the scope for the next `RegionAttributes` created.
  `RegionFactory<K,V>`
  `setStatisticsEnabled(boolean statisticsEnabled)`
  Sets whether statistics are enabled for this region and its entries.
  `RegionFactory<K,V>`
  `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<K,V>`
  `setValueConstraint(Class<V> valueConstraint)`
  Sets the value constraint for the next `RegionAttributes` created.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RegionFactory

    protected RegionFactory(org.apache.geode.internal.cache.InternalCache cache)
    For internal use only.
    Parameters:
      `cache` - the cache
    Since:
      GemFire 6.5

  - ### RegionFactory

    protected RegionFactory(org.apache.geode.internal.cache.InternalCache cache, RegionShortcut pra)
    For internal use only.
    Parameters:
      `cache` - the cache
      `pra` - the `RegionShortcut` with which to initialize the Region
    Since:
      GemFire 6.5

  - ### RegionFactory

    protected RegionFactory(org.apache.geode.internal.cache.InternalCache cache, RegionAttributes ra)
    For internal use only.
    Parameters:
      `cache` - the cache
      `ra` - the `RegionAttributes` with which to initialize the Region
    Since:
      GemFire 6.5

  - ### RegionFactory

    @VisibleForTesting protected RegionFactory(RegionFactory<K,V> regionFactory)
    Constructs a RegionFactory that is a copy of an existing RegionFactory
    Parameters:
      `regionFactory` - the RegionFactory to copy
    Since:
      Geode 1.12.0

  - ### RegionFactory

    protected RegionFactory(org.apache.geode.internal.cache.InternalCache cache, String regionAttributesId)
    For internal use only.
    Parameters:
      `cache` - the cache
      `regionAttributesId` - the id of the `RegionAttributes` with which to initialize the Region
    Since:
      GemFire 6.5

  - ### RegionFactory

    @Deprecated public RegionFactory() throws CacheWriterException, RegionExistsException, TimeoutException
    Deprecated.
    as of 6.5 use `Cache.createRegionFactory()` instead.
    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`

  - ### RegionFactory

    @Deprecated public RegionFactory(RegionAttributes<K,V> regionAttributes) throws CacheWriterException, RegionExistsException, TimeoutException
    Deprecated.
    as of 6.5 use `Cache.createRegionFactory(RegionAttributes)` instead.
    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.
    Parameters:
      `regionAttributes` - the `RegionAttributes` with which to initialize the Region
    Throws:
      `CacheException` - if unable to connect the DistributedSystem or create a Cache
      `CacheWriterException`
      `RegionExistsException`
      `TimeoutException`

  - ### RegionFactory

    @Deprecated public RegionFactory(String regionAttributesId) throws CacheWriterException, RegionExistsException, TimeoutException
    Deprecated.
    as of 6.5 use `Cache.createRegionFactory(String)` instead.
    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`
    See Also:
      - `GemFireCache.getRegionAttributes(java.lang.String)`

  - ### RegionFactory

    @Deprecated public RegionFactory(Properties distributedSystemProperties) throws CacheWriterException, RegionExistsException, TimeoutException
    Deprecated.
    as of 6.5 use `CacheFactory(Properties)` and `Cache.createRegionFactory()` instead.
    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 `DistributedSystem` configuration
    Throws:
      `CacheException` - if unable to connect the DistributedSystem or create a Cache
      `CacheWriterException`
      `RegionExistsException`
      `TimeoutException`

  - ### RegionFactory

    @Deprecated public RegionFactory(Properties distributedSystemProperties, RegionAttributes<K,V> regionAttributes) throws CacheWriterException, RegionExistsException, TimeoutException
    Deprecated.
    as of 6.5 use `CacheFactory(Properties)` and `Cache.createRegionFactory(RegionAttributes)` instead.
    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`

  - ### RegionFactory

    @Deprecated public RegionFactory(Properties distributedSystemProperties, String regionAttributesId) throws CacheWriterException, RegionExistsException, TimeoutException
    Deprecated.
    as of 6.5 use `CacheFactory(Properties)` and `Cache.createRegionFactory(String)` instead.
    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`

- ## Method Details

  - ### getCache

    protected org.apache.geode.internal.cache.InternalCache getCache()
    Returns the cache used by this factory.
    Returns:
      he cache used by this factory

  - ### getRegionAttributes

    protected RegionAttributes<K,V> getRegionAttributes()
    Returns the attributes used by this factory to create a region.
    Returns:
      the attributes used by this factory to create a region

  - ### setCacheLoader

    public RegionFactory<K,V> setCacheLoader(CacheLoader<K,V> 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(org.apache.geode.cache.CacheLoader<K, V>)`

  - ### setCacheWriter

    public RegionFactory<K,V> setCacheWriter(CacheWriter<K,V> 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(org.apache.geode.cache.CacheWriter<K, V>)`

  - ### addCacheListener

    public RegionFactory<K,V> addCacheListener(CacheListener<K,V> 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(org.apache.geode.cache.CacheListener<K, V>)`

  - ### initCacheListeners

    public RegionFactory<K,V> initCacheListeners(CacheListener<K,V>[] 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(org.apache.geode.cache.CacheListener<K, V>[])`

  - ### setEvictionAttributes

    public RegionFactory<K,V> 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<K,V> setEntryIdleTimeout(ExpirationAttributes idleTimeout)
    Sets the idleTimeout expiration attributes for region entries for the next `RegionAttributes` created. Note that the XML element that corresponds to this method "entry-idle-time", does not include "out" in its name.
    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(org.apache.geode.cache.ExpirationAttributes)`

  - ### setCustomEntryIdleTimeout

    public RegionFactory<K,V> setCustomEntryIdleTimeout(CustomExpiry<K,V> 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<K,V> 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(org.apache.geode.cache.ExpirationAttributes)`

  - ### setCustomEntryTimeToLive

    public RegionFactory<K,V> setCustomEntryTimeToLive(CustomExpiry<K,V> 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<K,V> setRegionIdleTimeout(ExpirationAttributes idleTimeout)
    Sets the idleTimeout expiration attributes for the region itself for the next `RegionAttributes` created. Note that the XML element that corresponds to this method "region-idle-time", does not include "out" in its name.
    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(org.apache.geode.cache.ExpirationAttributes)`

  - ### setRegionTimeToLive

    public RegionFactory<K,V> 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(org.apache.geode.cache.ExpirationAttributes)`

  - ### setScope

    public RegionFactory<K,V> 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(org.apache.geode.cache.Scope)`

  - ### setDataPolicy

    public RegionFactory<K,V> 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(org.apache.geode.cache.DataPolicy)`

  - ### setEarlyAck

    @Deprecated public RegionFactory<K,V> setEarlyAck(boolean earlyAck)
    Deprecated.
    As of 6.5 this setting no longer has any effect.
    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<K,V> 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:
      GemFire 5.0
    See Also:
      - `AttributesFactory.setMulticastEnabled(boolean)`

  - ### setPoolName

    public RegionFactory<K,V> 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:
      GemFire 5.7

  - ### setPublisher

    @Deprecated public void setPublisher(boolean v)
    Deprecated.
    as of 6.5
    Sets whether or not this region should be considered a publisher.
    Parameters:
      `v` - whether this region should be considered a publisher
    Since:
      GemFire 5.0

  - ### setEnableAsyncConflation

    public RegionFactory<K,V> 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)`

  - ### setEnableSubscriptionConflation

    public RegionFactory<K,V> setEnableSubscriptionConflation(boolean value)
    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<K,V> setKeyConstraint(Class<K> 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<K>)`

  - ### setValueConstraint

    public RegionFactory<K,V> setValueConstraint(Class<V> 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<V>)`

  - ### setInitialCapacity

    public RegionFactory<K,V> 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<K,V> 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<K,V> 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)`

  - ### setConcurrencyChecksEnabled

    public RegionFactory<K,V> setConcurrencyChecksEnabled(boolean enabled)
    Enables a versioning system that detects concurrent modifications and ensures that region contents are consistent across the distributed system. This setting must be the same in each member having the region.
    Parameters:
      `enabled` - whether concurrency checks should be enabled for the region
    Returns:
      a reference to this RegionFactory object
    Since:
      GemFire 7.0
    See Also:
      - `AttributesFactory.setConcurrencyChecksEnabled(boolean)`

  - ### setDiskWriteAttributes

    @Deprecated public RegionFactory<K,V> setDiskWriteAttributes(DiskWriteAttributes attrs)
    Deprecated.
    as of 6.5 use `setDiskStoreName(java.lang.String)` instead
    Sets the `DiskWriteAttributes` for this factory
    Parameters:
      `attrs` - the `DiskWriteAttributes` to be set for this factory
    Returns:
      a reference to this RegionFactory object
    See Also:
      - `Region.writeToDisk()`
      - `AttributesFactory.setDiskWriteAttributes(org.apache.geode.cache.DiskWriteAttributes)`

  - ### setDiskStoreName

    public RegionFactory<K,V> setDiskStoreName(String name)
    Sets the DiskStore name attribute. This causes the region to belong to the DiskStore.
    Parameters:
      `name` - the name of the diskstore
    Returns:
      a reference to this RegionFactory object
    Since:
      GemFire 6.5
    See Also:
      - `AttributesFactory.setDiskStoreName(java.lang.String)`

  - ### setDiskSynchronous

    public RegionFactory<K,V> setDiskSynchronous(boolean isSynchronous)
    Sets whether or not the writing to the disk is synchronous.
    Parameters:
      `isSynchronous` - boolean if true indicates synchronous writes
    Returns:
      a reference to this RegionFactory object
    Since:
      GemFire 6.5

  - ### setDiskDirs

    @Deprecated public RegionFactory<K,V> setDiskDirs(File[] diskDirs)
    Deprecated.
    as of 6.5 use `DiskStoreFactory.setDiskDirs(java.io.File[])` instead
    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.
    Parameters:
      `diskDirs` - the directories to which the region's data is written
    Returns:
      a reference to this RegionFactory object
    See Also:
      - `AttributesFactory.setDiskDirs(java.io.File[])`

  - ### setDiskDirsAndSizes

    @Deprecated public RegionFactory<K,V> setDiskDirsAndSizes(File[] diskDirs, int[] diskSizes)
    Deprecated.
    as of 6.5 use `DiskStoreFactory.setDiskDirsAndSizes(java.io.File[], int[])` instead
    Sets the directories to which the region's data are written and also set their sizes in megabytes
    Parameters:
      `diskDirs` - the directories to which the region's data is written
      `diskSizes` - the size in megabytes for each directory
    Returns:
      a reference to this RegionFactory object
    Throws:
      `IllegalArgumentException` - if length of the size array does not match to the length of the dir array
    Since:
      GemFire 5.1
    See Also:
      - `AttributesFactory.setDiskDirsAndSizes(java.io.File[], int[])`

  - ### setPartitionAttributes

    public RegionFactory<K,V> setPartitionAttributes(PartitionAttributes partition)
    Sets the `PartitionAttributes` that describe how the region is partitioned among members of the distributed system.
    Parameters:
      `partition` - 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(org.apache.geode.cache.PartitionAttributes)`

  - ### setMembershipAttributes

    @Deprecated public RegionFactory<K,V> setMembershipAttributes(MembershipAttributes ra)
    Deprecated.
    this API is scheduled to be removed
    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(org.apache.geode.cache.MembershipAttributes)`

  - ### setIndexMaintenanceSynchronous

    public RegionFactory<K,V> 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<K,V> 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<K,V> setIgnoreJTA(boolean flag)
    Sets whether operations on this region should be controlled by JTA transactions or not
    Parameters:
      `flag` - whether operations on this region should be controlled by JTA transactions
    Returns:
      a reference to this RegionFactory object
    Since:
      GemFire 5.0

  - ### setLockGrantor

    public RegionFactory<K,V> 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<K,V> 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)`

  - ### create

    public Region<K,V> create(String name) throws CacheExistsException, RegionExistsException, CacheWriterException, TimeoutException
    Creates a region with the given name in this factory's `Cache` using the configuration contained in this factory. 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 are incompatible with this region in another cache in the distributed system (see `AttributesFactory` for compatibility rules)
      `CacheExistsException`
      `CacheWriterException`

  - ### createSubregion

    public Region<K,V> createSubregion(Region<?,?> parent, String name) throws RegionExistsException
    Creates a sub-region in the `Cache` using 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:
      `parent` - the existing region that will contain the created sub-region
      `name` - the name of the region to create
    Returns:
      the region object
    Throws:
      `RegionExistsException` - if a region with the given name already exists in this cache
      `RegionDestroyedException` - if the parent region has been closed or destroyed
      `CacheClosedException` - if the cache is closed
    Since:
      GemFire 7.0

  - ### setCloningEnabled

    public RegionFactory<K,V> setCloningEnabled(boolean cloningEnable)
    Sets cloning on region Note: off-heap regions always behave as if cloning is enabled.
    Parameters:
      `cloningEnable` - whether cloning is enabled for the region
    Returns:
      a reference to this RegionFactory object
    Since:
      GemFire 6.1
    See Also:
      - `AttributesFactory.setCloningEnabled(boolean)`

  - ### addGatewaySenderId

    public RegionFactory<K,V> addGatewaySenderId(String gatewaySenderId)
    Adds a gatewaySenderId to the RegionAttributes
    Parameters:
      `gatewaySenderId` - the gatewaySenderId to add
    Returns:
      a reference to this RegionFactory object
    Since:
      GemFire 7.0
    See Also:
      - `AttributesFactory.addGatewaySenderId(String)`

  - ### addAsyncEventQueueId

    public RegionFactory<K,V> addAsyncEventQueueId(String asyncEventQueueId)
    Adds a asyncEventQueueId to the RegionAttributes
    Parameters:
      `asyncEventQueueId` - id of AsyncEventQueue
    Returns:
      a reference to this RegionFactory instance
    Since:
      GemFire 7.0

  - ### setCompressor

    public RegionFactory<K,V> setCompressor(Compressor compressor)
    Set the compressor to be used by this region for compressing region entry values.
    Parameters:
      `compressor` - a compressor
    Returns:
      a reference to this RegionFactory instance
    Since:
      GemFire 8.0

  - ### setOffHeap

    public RegionFactory<K,V> setOffHeap(boolean offHeap)
    Enables this region's usage of off-heap memory if true.
    Parameters:
      `offHeap` - boolean flag to enable off-heap memory
    Returns:
      a reference to this RegionFactory instance
    Since:
      Geode 1.0