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 BridgeLoader, BridgeWriter, and all LRUAlgorithm instances will
be cloned so that each dynamic Region has its own callback.
Modifier and Type | Class and Description |
---|---|
static class |
DynamicRegionFactory.Config
Configuration for dynamic region factory.
|
Modifier and Type | Field and Description |
---|---|
static String |
dynamicRegionListName |
Constructor and Description |
---|
DynamicRegionFactory() |
Modifier and Type | Method and Description |
---|---|
Region |
createDynamicRegion(String parentRegionName,
String regionName)
Creates the dynamic Region in the local cache and distributes the
creation to other caches.
|
void |
destroyDynamicRegion(String fullRegionName)
Destroys the dynamic Region in the local cache and distributes the
destruction to other caches.
|
static DynamicRegionFactory |
get()
Returns the
DynamicRegionFactory singleton instance. |
DynamicRegionFactory.Config |
getConfig()
Returns the configuration for this factory.
|
boolean |
isActive()
Returns true if this factory is open and can produce dynamic regions.
|
boolean |
isClosed()
Returns true if dynamic region factory is closed.
|
boolean |
isOpen()
Returns true if dynamic region factory is open; false if closed.
|
void |
open()
Opens the DynamicRegionFactory with default settings.
|
void |
open(DynamicRegionFactory.Config conf)
Opens the factory with the given settings.
|
static boolean |
regionIsDynamicRegionList(String regionPath) |
void |
registerDynamicRegionListener(DynamicRegionListener listener)
Registers a
DynamicRegionListener for callbacks. |
void |
unregisterDynamicRegionListener(DynamicRegionListener listener)
Unregisters a
DynamicRegionListener for callbacks. |
public static final String dynamicRegionListName
public void open()
public void open(DynamicRegionFactory.Config conf)
conf
- the configuration for this factory.public boolean isOpen()
public boolean isActive()
public boolean isClosed()
public DynamicRegionFactory.Config getConfig()
public static boolean regionIsDynamicRegionList(String regionPath)
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 destroyedCacheException
RegionDestroyedException
- if the dynamic region was never created
or has already been destroyedCopyright © 1997-2017 Pivotal Software, Inc. All rights reserved.