GemFire 6.6.3

com.gemstone.gemfire.cache
Interface AttributesMutator<K,V>


public interface AttributesMutator<K,V>

Supports modification of certain region attributes after the region has been created. It is recommended that the attributes be completely initialized using an AttributesFactory before creating the region instead of using an AttributesMutator after region creation. This will avoid a potential performance penalty due to the additional network traffic.

The setter methods all return the previous value of the attribute.

Since:
3.0
See Also:
Region.getAttributesMutator(), RegionAttributes, AttributesFactory

Method Summary
 void addCacheListener(CacheListener<K,V> aListener)
          Adds a cache listener to the end of the list of cache listeners on this region.
 boolean getCloningEnabled()
          Returns whether or not cloning is enabled on region
 EvictionAttributesMutator getEvictionAttributesMutator()
          Allows changing the eviction controller attributes for the region.
 Region<K,V> getRegion()
          Returns the Region whose attributes this mutator affects.
 void initCacheListeners(CacheListener<K,V>[] newListeners)
          Removes all cache listeners, calling CacheCallback.close() on each of them, and then adds each listener in the specified array.
 void removeCacheListener(CacheListener<K,V> aListener)
          Removes a cache listener from the list of cache listeners on this region.
 CacheListener<K,V> setCacheListener(CacheListener<K,V> aListener)
          Deprecated. as of GemFire 5.0, use addCacheListener(com.gemstone.gemfire.cache.CacheListener) or initCacheListeners(com.gemstone.gemfire.cache.CacheListener[]) instead.
 CacheLoader<K,V> setCacheLoader(CacheLoader<K,V> cacheLoader)
          Changes the cache loader for the region.
 CacheWriter<K,V> setCacheWriter(CacheWriter<K,V> cacheWriter)
          Changes the cache writer for the region.
 void setCloningEnabled(boolean cloningEnable)
          Sets cloning on region
 CustomExpiry<K,V> setCustomEntryIdleTimeout(CustomExpiry<K,V> custom)
          Changes the CustomExpiry for idleTimeout for values in the region
 CustomExpiry<K,V> setCustomEntryTimeToLive(CustomExpiry<K,V> custom)
          Changes the custom timeToLive for values in this region
 ExpirationAttributes setEntryIdleTimeout(ExpirationAttributes idleTimeout)
          Changes the idleTimeout expiration attributes for values in the region.
 ExpirationAttributes setEntryTimeToLive(ExpirationAttributes timeToLive)
          Changes the timeToLive expiration attributes for values in this region.
 ExpirationAttributes setRegionIdleTimeout(ExpirationAttributes idleTimeout)
          Changes the idleTimeout expiration attributes for the region as a whole.
 ExpirationAttributes setRegionTimeToLive(ExpirationAttributes timeToLive)
          Changes the timeToLive expiration attributes for the region as a whole
 

Method Detail

getRegion

Region<K,V> getRegion()
Returns the Region whose attributes this mutator affects.

Returns:
the Region this mutator affects

setRegionTimeToLive

ExpirationAttributes setRegionTimeToLive(ExpirationAttributes timeToLive)
Changes the timeToLive expiration attributes for the region as a whole

Parameters:
timeToLive - the expiration attributes for the region timeToLive
Returns:
the previous value of region timeToLive
Throws:
IllegalArgumentException - if timeToLive is null or if the ExpirationAction is LOCAL_INVALIDATE and the region is replicated
IllegalStateException - if statistics are disabled for this region.

setRegionIdleTimeout

ExpirationAttributes setRegionIdleTimeout(ExpirationAttributes idleTimeout)
Changes the idleTimeout expiration attributes for the region as a whole. Resets the CacheStatistics.getLastAccessedTime() for the region.

Parameters:
idleTimeout - the ExpirationAttributes for this region idleTimeout
Returns:
the previous value of region idleTimeout
Throws:
IllegalArgumentException - if idleTimeout is null or if the ExpirationAction is LOCAL_INVALIDATE and the region is replicated
IllegalStateException - if statistics are disabled for this region.

setEntryTimeToLive

ExpirationAttributes setEntryTimeToLive(ExpirationAttributes timeToLive)
Changes the timeToLive expiration attributes for values in this region.

Parameters:
timeToLive - the timeToLive expiration attributes for entries
Returns:
the previous value of entry timeToLive
Throws:
IllegalArgumentException - if timeToLive is null or if the ExpirationAction is LOCAL_DESTROY and the region is replicated or if the ExpirationAction is LOCAL_INVALIDATE and the region is replicated
IllegalStateException - if statistics are disabled for this region.

setCustomEntryTimeToLive

CustomExpiry<K,V> setCustomEntryTimeToLive(CustomExpiry<K,V> custom)
Changes the custom timeToLive for values in this region

Parameters:
custom - the new CustomExpiry
Returns:
the old CustomExpiry

setEntryIdleTimeout

ExpirationAttributes setEntryIdleTimeout(ExpirationAttributes idleTimeout)
Changes the idleTimeout expiration attributes for values in the region.

Parameters:
idleTimeout - the idleTimeout expiration attributes for entries
Returns:
the previous value of entry idleTimeout
Throws:
IllegalArgumentException - if idleTimeout is null or if the ExpirationAction is LOCAL_DESTROY and the region is replicated or if the the ExpirationAction is LOCAL_INVALIDATE and the region is replicated
IllegalStateException - if statistics are disabled for this region.
See Also:
AttributesFactory.setStatisticsEnabled(boolean)

setCustomEntryIdleTimeout

CustomExpiry<K,V> setCustomEntryIdleTimeout(CustomExpiry<K,V> custom)
Changes the CustomExpiry for idleTimeout for values in the region

Parameters:
custom - the new CustomExpiry
Returns:
the old CustomExpiry

setCacheListener

@Deprecated
CacheListener<K,V> setCacheListener(CacheListener<K,V> aListener)
Deprecated. as of GemFire 5.0, use addCacheListener(com.gemstone.gemfire.cache.CacheListener) or initCacheListeners(com.gemstone.gemfire.cache.CacheListener[]) instead.

Changes the CacheListener for the region. Removes listeners already added and calls CacheCallback.close() on each of them.

Parameters:
aListener - a user defined cache listener
Returns:
the previous CacheListener if a single one exists; otherwise null.
Throws:
IllegalStateException - if more than one cache listener has already been added

addCacheListener

void addCacheListener(CacheListener<K,V> aListener)
Adds a cache listener to the end of the list of cache listeners on this region.

Parameters:
aListener - the user defined cache listener to add to the region.
Throws:
IllegalArgumentException - if aListener is null
Since:
5.0

removeCacheListener

void removeCacheListener(CacheListener<K,V> aListener)
Removes a cache listener from the list of cache listeners on this region. Does nothing if the specified listener has not been added. If the specified listener has been added then CacheCallback.close() will be called on it; otherwise does nothing.

Parameters:
aListener - the cache listener to remove from the region.
Throws:
IllegalArgumentException - if aListener is null
Since:
5.0

initCacheListeners

void initCacheListeners(CacheListener<K,V>[] newListeners)
Removes all cache listeners, calling CacheCallback.close() on each of them, and then adds each listener in the specified array.

Parameters:
newListeners - a possibly null or empty array of listeners to add to this region.
Throws:
IllegalArgumentException - if the newListeners array has a null element
Since:
5.0

setCacheWriter

CacheWriter<K,V> setCacheWriter(CacheWriter<K,V> cacheWriter)
Changes the cache writer for the region.

Parameters:
cacheWriter - the cache writer
Returns:
the previous CacheWriter

setCacheLoader

CacheLoader<K,V> setCacheLoader(CacheLoader<K,V> cacheLoader)
Changes the cache loader for the region.

Parameters:
cacheLoader - the cache loader
Returns:
the previous CacheLoader

getEvictionAttributesMutator

EvictionAttributesMutator getEvictionAttributesMutator()
Allows changing the eviction controller attributes for the region.

Returns:
the EvictionAttributesMutator used to change the EvictionAttributes

setCloningEnabled

void setCloningEnabled(boolean cloningEnable)
Sets cloning on region

Parameters:
cloningEnable -
Since:
6.1

getCloningEnabled

boolean getCloningEnabled()
Returns whether or not cloning is enabled on region

Returns:
True if cloning is enabled (default); false cloning is not enabled.
Since:
6.1

GemFire 6.6.3

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