GemFire 6.6

com.gemstone.gemfire.cache
Class DynamicRegionFactory

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

public abstract class DynamicRegionFactory
extends Object

DynamicRegionFactory provides a distributed region creation service. Any other member of the GemFire DistributedSystem that has created an instance of this class will automatically instantiate regions created through the factory from anywhere else in the DistributedSystem.

Instructions for Use:

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:

Since:
4.3

Nested Class Summary
static class DynamicRegionFactory.Config
          Configuration for dynamic region factory.
 
Constructor Summary
DynamicRegionFactory()
           
 
Method Summary
 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 config)
          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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicRegionFactory

public DynamicRegionFactory()
Method Detail

open

public void open()
Opens the DynamicRegionFactory with default settings.


open

public void open(DynamicRegionFactory.Config config)
Opens the factory with the given settings. This should be sent to the factory before creating a cache. The cache will otherwise open a factory with default settings. This does not need to be sent if the cache.xml declares the use of dynamic regions.

Parameters:
config - the configuration for this factory.

isOpen

public boolean isOpen()
Returns true if dynamic region factory is open; false if closed.


isActive

public boolean isActive()
Returns true if this factory is open and can produce dynamic regions. Factories are only active after their cache has been created.


isClosed

public boolean isClosed()
Returns true if dynamic region factory is closed.


getConfig

public DynamicRegionFactory.Config getConfig()
Returns the configuration for this factory. Returns null if the factory is closed;


regionIsDynamicRegionList

public static boolean regionIsDynamicRegionList(String regionPath)

get

public static DynamicRegionFactory get()
Returns the DynamicRegionFactory singleton instance.

Returns:
the DynamicRegionFactory singleton instance

registerDynamicRegionListener

public void registerDynamicRegionListener(DynamicRegionListener listener)
Registers a DynamicRegionListener for callbacks.

Parameters:
listener - The DynamicRegionListener to be registered

unregisterDynamicRegionListener

public void unregisterDynamicRegionListener(DynamicRegionListener listener)
Unregisters a DynamicRegionListener for callbacks.

Parameters:
listener - The DynamicRegionListener to be unregistered

createDynamicRegion

public Region createDynamicRegion(String parentRegionName,
                                  String regionName)
                           throws CacheException
Creates the dynamic Region in the local cache and distributes the creation to other caches.

Parameters:
parentRegionName - the new region is created as a subregion of the region having this path
regionName - the name of the new subregion
Returns:
the Region created
Throws:
CacheException

destroyDynamicRegion

public void destroyDynamicRegion(String fullRegionName)
                          throws CacheException
Destroys the dynamic Region in the local cache and distributes the destruction to other caches.

Parameters:
fullRegionName - The full path of the Region to be dynamically destroyed
Throws:
CacheException
RegionDestroyedException - if the dynamic region was never created or has already been destroyed

GemFire 6.6

Copyright © 1997-2011 VMware, Inc. All rights reserved.