|
GemFire 6.6.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ClientRegionFactory<K,V>
A factory for constructing client cache regions. Instances of this interface can be created using region shortcuts
by calling
ClientCache.createClientRegionFactory(ClientRegionShortcut) or using
named region attributes by calling
ClientCache.createClientRegionFactory(String).
The factory can then be customized using its methods.
The final step is to produce a Region by calling
create(String).
Client regions may be:
ClientRegionShortcut for the shortcuts for these three types of
client regions.
Example: Create a client region with a CacheListener
ClientCache c = new ClientCacheFactory().addLocator(host, port).create();
// Create local caching region that is connected to a server side region
// Add a cache listener before creating region
Region r = c.createClientRegionFactory(CACHING_PROXY).addCacheListener(
myListener).create("customers");
| Method Summary | |
|---|---|
ClientRegionFactory<K,V> |
addCacheListener(CacheListener<K,V> aListener)
Adds a cache listener to the end of the list of cache listeners on this factory. |
Region<K,V> |
create(String name)
Creates a region in the ClientCache using
the configuration contained in this ClientRegionFactory. |
ClientRegionFactory<K,V> |
initCacheListeners(CacheListener<K,V>[] newListeners)
Removes all cache listeners and then adds each listener in the specified array. |
ClientRegionFactory<K,V> |
setCloningEnabled(boolean cloningEnable)
Sets cloning on region |
ClientRegionFactory<K,V> |
setConcurrencyLevel(int concurrencyLevel)
Sets the concurrency level tof the next RegionAttributes
created. |
ClientRegionFactory<K,V> |
setCustomEntryIdleTimeout(CustomExpiry<K,V> custom)
Sets the custom idleTimeout for the next RegionAttributes
created. |
ClientRegionFactory<K,V> |
setCustomEntryTimeToLive(CustomExpiry<K,V> custom)
Sets the custom timeToLive expiration method for the next RegionAttributes created. |
ClientRegionFactory<K,V> |
setDiskStoreName(String name)
Sets the DiskStore name attribute. |
ClientRegionFactory<K,V> |
setDiskSynchronous(boolean isSynchronous)
Sets whether or not the writing to the disk is synchronous. |
ClientRegionFactory<K,V> |
setEntryIdleTimeout(ExpirationAttributes idleTimeout)
Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created. |
ClientRegionFactory<K,V> |
setEntryTimeToLive(ExpirationAttributes timeToLive)
Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created. |
ClientRegionFactory<K,V> |
setEvictionAttributes(EvictionAttributes evictionAttributes)
Sets the eviction attributes that controls growth of the Region to be created. |
ClientRegionFactory<K,V> |
setInitialCapacity(int initialCapacity)
Sets the entry initial capacity for the next RegionAttributes
created. |
ClientRegionFactory<K,V> |
setKeyConstraint(Class<K> keyConstraint)
Sets the key constraint for the next RegionAttributes
created. |
ClientRegionFactory<K,V> |
setLoadFactor(float loadFactor)
Sets the entry load factor for the next RegionAttributes
created. |
ClientRegionFactory<K,V> |
setPoolName(String poolName)
Sets the pool name attribute. |
ClientRegionFactory<K,V> |
setRegionIdleTimeout(ExpirationAttributes idleTimeout)
Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created. |
ClientRegionFactory<K,V> |
setRegionTimeToLive(ExpirationAttributes timeToLive)
Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created. |
ClientRegionFactory<K,V> |
setStatisticsEnabled(boolean statisticsEnabled)
Sets whether statistics are enabled for this region and its entries. |
ClientRegionFactory<K,V> |
setValueConstraint(Class<V> valueConstraint)
Sets the value constraint for the next RegionAttributes
created. |
| Method Detail |
|---|
ClientRegionFactory<K,V> addCacheListener(CacheListener<K,V> aListener)
aListener - the cache listener to add
IllegalArgumentException - if aListener is nullAttributesFactory.addCacheListener(com.gemstone.gemfire.cache.CacheListener) ClientRegionFactory<K,V> initCacheListeners(CacheListener<K,V>[] newListeners)
RegionAttributes created.
newListeners - a possibly null or empty array of listeners to add to this factory.
IllegalArgumentException - if the newListeners array has a null elementAttributesFactory.initCacheListeners(com.gemstone.gemfire.cache.CacheListener[]) ClientRegionFactory<K,V> setEvictionAttributes(EvictionAttributes evictionAttributes)
evictionAttributes - for the Region to create
ClientRegionFactory<K,V> setEntryIdleTimeout(ExpirationAttributes idleTimeout)
RegionAttributes created.
idleTimeout - the idleTimeout ExpirationAttributes for entries in this region
IllegalArgumentException - if idleTimeout is nullAttributesFactory.setEntryIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes)ClientRegionFactory<K,V> setCustomEntryIdleTimeout(CustomExpiry<K,V> custom)
RegionAttributes
created.
custom - the custom method
AttributesFactory.setCustomEntryIdleTimeout(CustomExpiry)ClientRegionFactory<K,V> setEntryTimeToLive(ExpirationAttributes timeToLive)
RegionAttributes created.
timeToLive - the timeToLive ExpirationAttributes for entries in this region
IllegalArgumentException - if timeToLive is nullAttributesFactory.setEntryTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes)ClientRegionFactory<K,V> setCustomEntryTimeToLive(CustomExpiry<K,V> custom)
RegionAttributes created.
custom - the custom method
AttributesFactory.setCustomEntryTimeToLive(CustomExpiry)ClientRegionFactory<K,V> setRegionIdleTimeout(ExpirationAttributes idleTimeout)
RegionAttributes created.
idleTimeout - the ExpirationAttributes for this region idleTimeout
IllegalArgumentException - if idleTimeout is nullAttributesFactory.setRegionIdleTimeout(com.gemstone.gemfire.cache.ExpirationAttributes)ClientRegionFactory<K,V> setRegionTimeToLive(ExpirationAttributes timeToLive)
RegionAttributes created.
timeToLive - the ExpirationAttributes for this region timeToLive
IllegalArgumentException - if timeToLive is nullAttributesFactory.setRegionTimeToLive(com.gemstone.gemfire.cache.ExpirationAttributes)ClientRegionFactory<K,V> setKeyConstraint(Class<K> keyConstraint)
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.
keyConstraint - The Class to constrain the keys to, or null if no constraint
IllegalArgumentException - if keyConstraint is a class denoting a primitive
typeAttributesFactory.setKeyConstraint(java.lang.Class) ClientRegionFactory<K,V> setValueConstraint(Class<V> valueConstraint)
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.
valueConstraint - The Class to constrain the values to, or null if no constraint
IllegalArgumentException - if valueConstraint is a class denoting a primitive
typeAttributesFactory.setValueConstraint(java.lang.Class) ClientRegionFactory<K,V> setInitialCapacity(int initialCapacity)
RegionAttributes
created. This value is used in initializing the map that holds the entries.
initialCapacity - the initial capacity of the entry map
IllegalArgumentException - if initialCapacity is negative.HashMap,
AttributesFactory.setInitialCapacity(int)ClientRegionFactory<K,V> setLoadFactor(float loadFactor)
RegionAttributes
created. This value is used in initializing the map that holds the entries.
loadFactor - the load factor of the entry map
IllegalArgumentException - if loadFactor is nonpositiveHashMap,
AttributesFactory.setLoadFactor(float)ClientRegionFactory<K,V> setConcurrencyLevel(int concurrencyLevel)
RegionAttributes
created. This value is used in initializing the map that holds the entries.
concurrencyLevel - the concurrency level of the entry map
IllegalArgumentException - if concurrencyLevel is nonpositiveAttributesFactory.setConcurrencyLevel(int)ClientRegionFactory<K,V> setDiskStoreName(String name)
name - the name of the diskstore
AttributesFactory.setDiskStoreName(java.lang.String)ClientRegionFactory<K,V> setDiskSynchronous(boolean isSynchronous)
isSynchronous - boolean if true indicates synchronous writes
ClientRegionFactory<K,V> setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled - whether statistics are enabled
AttributesFactory.setStatisticsEnabled(boolean)ClientRegionFactory<K,V> setCloningEnabled(boolean cloningEnable)
cloningEnable -
AttributesFactory.setCloningEnabled(boolean)ClientRegionFactory<K,V> setPoolName(String poolName)
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.
poolName - the name of the connection pool to use
IllegalStateException - if a cache loader or cache writer has already
been set.PoolManager
Region<K,V> create(String name)
throws RegionExistsException
ClientCache using
the configuration contained in this ClientRegionFactory. Validation of the
provided attributes may cause exceptions to be thrown if there are problems
with the configuration data.
name - the name of the region to create
RegionExistsException - if a region with the given name already exists in this cache
CacheClosedException - if the cache is closed
|
GemFire 6.6.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||