FunctionService
to create regions on other
members instead.@Deprecated public abstract class DynamicRegionFactory extends Object
Instructions for Use:
DynamicRegionFactory.Config
you'll use to create a DynamicRegionFactory or
specify it in a dynamic-region-factory element in your cache.xml.
{ DynamicRegionFactory factory = DynamicRegionFactory.get(); factory.open(config); }
{ DynamicRegionFactory myFactoryHandle = DynamicRegionFactory.get().open(config); }or just use a dynamic-region-factory element in the cache.xml.
DynamicRegionFactory.Config.persistBackup
) or from other members of the distributed
system. These dynamic Regions will be created before Cache creation completes.
createDynamicRegion(java.lang.String, java.lang.String)
. Regions created with the factory will inherit their
RegionAttributes from their parent Region, though you can override callbacks when you configure
the factory.
All other instances of GemFire across the distributed system that instantiate and open a DynamicRegionFactory will also get the dynamic distributed Regions.
Saving the factory on disk: If DynamicRegionFactory.Config.persistBackup
is configured
for the factory, dynamic Region information is written to disk for recovery. By default the
current directory is used for this information. The DynamicRegionFactory.Config.diskDir
can be used to change this default.
Registering interest in cache server information: The
DynamicRegionFactory.Config.registerInterest
setting determines whether clients will
register interest in server keys or not. You will generally want this to be turned on so that
clients will see updates made to servers. In server processes, DynamicRegionFactory forces use of
NotifyBySubscription.
Notes:
open()
is called before cache creation and the cache.xml has a
dynamic-region-factory element then the cache.xml will override the open call's configuration.
CacheListener
, CacheWriter
, and CacheLoader
are shared by
the parent and all its dynamic children so make sure the callback is thread-safe and that its
CacheCallback.close()
implementation does not stop it from functioning. However the
products EvictionAlgorithm instances will be cloned so that each dynamic Region has its own
callback.
Modifier and Type | Class and Description |
---|---|
static class |
DynamicRegionFactory.Config
Deprecated.
Configuration for dynamic region factory.
|
Modifier and Type | Field and Description |
---|---|
static String |
DYNAMIC_REGION_LIST_NAME
Deprecated.
|
Constructor and Description |
---|
DynamicRegionFactory()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildDynamicRegion(EntryEvent event)
Deprecated.
|
Region |
createDynamicRegion(String parentRegionName,
String regionName)
Deprecated.
Creates the dynamic Region in the local cache and distributes the creation to other caches.
|
void |
destroyDynamicRegion(String fullRegionName)
Deprecated.
Destroys the dynamic Region in the local cache and distributes the destruction to other caches.
|
protected void |
doClose()
Deprecated.
Closes the dynamic region factory, disabling any further creation or destruction of dynamic
regions in this cache.
|
protected void |
doInternalInit(org.apache.geode.internal.cache.InternalCache theCache)
Deprecated.
The method is for internal use only.
|
static DynamicRegionFactory |
get()
Deprecated.
Returns the
DynamicRegionFactory singleton instance. |
DynamicRegionFactory.Config |
getConfig()
Deprecated.
Returns the configuration for this factory.
|
boolean |
isActive()
Deprecated.
Returns true if this factory is open and can produce dynamic regions.
|
boolean |
isClosed()
Deprecated.
Returns true if dynamic region factory is closed.
|
boolean |
isOpen()
Deprecated.
Returns true if dynamic region factory is open; false if closed.
|
void |
open()
Deprecated.
Opens the DynamicRegionFactory with default settings.
|
void |
open(DynamicRegionFactory.Config conf)
Deprecated.
Opens the factory with the given settings.
|
protected void |
razeDynamicRegion(EntryEvent event)
Deprecated.
|
static boolean |
regionIsDynamicRegionList(String regionPath)
Deprecated.
|
void |
registerDynamicRegionListener(DynamicRegionListener listener)
Deprecated.
Registers a
DynamicRegionListener for callbacks. |
void |
unregisterDynamicRegionListener(DynamicRegionListener listener)
Deprecated.
Unregisters a
DynamicRegionListener for callbacks. |
public static final String DYNAMIC_REGION_LIST_NAME
public void open()
public void open(DynamicRegionFactory.Config conf)
conf
- the configuration for this factory.protected void doClose()
public boolean isOpen()
public boolean isActive()
public boolean isClosed()
public DynamicRegionFactory.Config getConfig()
public static boolean regionIsDynamicRegionList(String regionPath)
protected void doInternalInit(org.apache.geode.internal.cache.InternalCache theCache) throws CacheException
This method is called internally during cache initialization at the correct time. Initialize the factory with a GemFire Cache. We create the metadata Region which holds all our dynamically created regions.
theCache
- The GemFire Cache
CacheException
public static DynamicRegionFactory get()
DynamicRegionFactory
singleton instance.DynamicRegionFactory
singleton instancepublic void registerDynamicRegionListener(DynamicRegionListener listener)
DynamicRegionListener
for callbacks.listener
- The DynamicRegionListener
to be registeredpublic void unregisterDynamicRegionListener(DynamicRegionListener listener)
DynamicRegionListener
for callbacks.listener
- The DynamicRegionListener
to be unregisteredpublic Region createDynamicRegion(String parentRegionName, String regionName) throws CacheException
parentRegionName
- the new region is created as a subregion of the region having this pathregionName
- the name of the new subregionRegion
createdCacheException
public void destroyDynamicRegion(String fullRegionName) throws CacheException
fullRegionName
- The full path of the Region
to be dynamically destroyedRegionDestroyedException
- if the dynamic region was never created or has already been
destroyedCacheException
protected void buildDynamicRegion(EntryEvent event)
protected void razeDynamicRegion(EntryEvent event)