GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue > Class Template Reference

Inherits GemStone::GemFire::Cache::Generic::Internal::UMWrap< gemfire::AttributesFactory >.


Detailed Description

template<class TKey, class TValue>
class GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >

Factory class to create instances of RegionAttributes.

An AttributesFactory instance maintains state for creating RegionAttributes instances. The setter methods are used to change the settings that will be used for creating the next attributes instance with the CreateRegionAttributes method. If you create a factory with the default constructor, then the factory is set up to create attributes with all default settings. You can also create a factory by providing a preset RegionAttributes.

Once a RegionAttributes is created, it can only be modified after it has been used to create a Region, and then only by using an AttributesMutator obtained from the region.

Attributes

Callbacks

[default: null]
User-implemented plug-in for loading data on cache misses.
see SetCacheLoader, RegionAttributes.CacheLoader

[default: null]
User-implemented plug-in for intercepting cache modifications, e.g. for writing to an external data source.
see SetCacheWriter, RegionAttributes.CacheWriter

[default: null]
User-implemented plug-in for receiving and handling cache-related events.
see SetCacheListener, RegionAttributes.CacheListener

[default: null]
User-implemented plug-in for custom partitioning.
see SetPartitionResolver, RegionAttributes.PartitionResolver

Expiration

RegionTimeToLive [default: no expiration]
Expiration configuration for the entire region based on the lastModifiedTime ( CacheStatistics.LastModifiedTime ).
see SetRegionTimeToLive, RegionAttributes.RegionTimeToLive, AttributesMutator.SetRegionTimeToLive

RegionIdleTimeout [default: no expiration]
Expiration configuration for the entire region based on the lastAccessedTime ( CacheStatistics.LastAccessedTime ).
see SetRegionIdleTimeout, RegionAttributes.RegionIdleTimeout, AttributesMutator.SetRegionIdleTimeout

EntryTimeToLive [default: no expiration]
Expiration configuration for individual entries based on the lastModifiedTime ( CacheStatistics.LastModifiedTime ).
see SetEntryTimeToLive, RegionAttributes.EntryTimeToLive, AttributesMutator.SetEntryTimeToLive

EntryIdleTimeout [default: no expiration]
Expiration configuration for individual entries based on the lastAccessedTime ( CacheStatistics.LastAccessedTime ).
see SetEntryIdleTimeout, RegionAttributes.EntryIdleTimeout, AttributesMutator.SetEntryIdleTimeout

Distribution

[default: ScopeType.DistributedNoAck]
The C++ cache can contain either local regions or distributed regions. Distributed regions are configured with servers that they distribute their operations to upto. Locally scoped regions do not have any distribution behavior. GFE native client regions scoped as ScopeType.DistributedNoAck and ScopeType.DistributedAck have identical distribution behavior.
see SetScope, RegionAttributes.Scope

Storage

InitialCapacity [default: 16]
The initial capacity of the map used for storing the entries.
see SetInitialCapacity, RegionAttributes.InitialCapacity

LoadFactor [default: 0.75]
The load factor of the map used for storing the entries.
see SetLoadFactor, RegionAttributes.LoadFactor

ConcurrencyLevel [default: 16]
The allowed concurrency among updates to values in the region is guided by the concurrencyLevel, which is used as a hint for internal sizing. The actual concurrency will vary. Ideally, you should choose a value to accommodate as many threads as will ever concurrently modify values in the region. Using a significantly higher value than you need can waste space and time, and a significantly lower value can lead to thread contention. But overestimates and underestimates within an order of magnitude do not usually have much noticeable impact. A value of one is appropriate when it is known that only one thread will modify and all others will only read.
see SetConcurrencyLevel, RegionAttributes.ConcurrencyLevel

See also:
RegionAttributes, AttributesMutator, Region.CreateSubRegion


Public Member Functions

 A (RegionAttributes< TKey, TValue >^regionAttributes)
 A ()
RegionAttributes
< TKey, TValue >^ 
CreateRegionAttributes ()
void SetCacheListener (String^ libPath, String^ factoryFunctionName)
void SetCacheListener (ICacheListener< TKey, TValue >^cacheListener)
void SetCacheLoader (String^ libPath, String^ factoryFunctionName)
void SetCacheLoader (ICacheLoader< TKey, TValue >^cacheLoader)
void SetCacheWriter (String^ libPath, String^ factoryFunctionName)
void SetCacheWriter (ICacheWriter< TKey, TValue >^cacheWriter)
void SetCachingEnabled (bool cachingEnabled)
void SetClientNotificationEnabled (bool clientNotificationEnabled)
void SetCloningEnabled (bool cloningEnabled)
void SetConcurrencyChecksEnabled (bool concurrencyChecksEnabled)
void SetConcurrencyLevel (int32_t concurrencyLevel)
void SetDiskPolicy (DiskPolicyType diskPolicy)
void SetEndpoints (String^ endpoints)
void SetEntryIdleTimeout (ExpirationAction action, uint32_t idleTimeout)
void SetEntryTimeToLive (ExpirationAction action, uint32_t timeToLive)
void SetInitialCapacity (int32_t initialCapacity)
void SetLoadFactor (Single loadFactor)
void SetLruEntriesLimit (uint32_t entriesLimit)
void SetPartitionResolver (String^ libPath, String^ factoryFunctionName)
void SetPartitionResolver (IPartitionResolver< TKey, TValue >^partitionresolver)
void SetPersistenceManager (String^ libPath, String^ factoryFunctionName, Properties< String^ , String^ >^config)
void SetPersistenceManager (String^ libPath, String^ factoryFunctionName)
void SetPersistenceManager (IPersistenceManager< TKey, TValue >^persistenceManager, Properties< String^ , String^ >^config)
void SetPersistenceManager (IPersistenceManager< TKey, TValue >^persistenceManager)
void SetPoolName (String^ poolName)
void SetRegionIdleTimeout (ExpirationAction action, uint32_t idleTimeout)
void SetRegionTimeToLive (ExpirationAction action, uint32_t timeToLive)
void SetScope (ScopeType scopeType)

Protected Member Functions

void InternalCleanup ()
void SetPtr (gemfire::AttributesFactory *nativeptr, bool own)

Properties

bool Own [get, set]

Member Function Documentation

template<class TKey, class TValue>
GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::A ( RegionAttributes< TKey, TValue >^  regionAttributes  ) 

Creates a new instance of AttributesFactory ready to create a RegionAttributes with the same settings as those in the specified RegionAttributes.

Parameters:
regionAttributes attributes used to initialize this AttributesFactory

template<class TKey, class TValue>
GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::A (  )  [inline]

Creates a new AttributesFactory ready to create a RegionAttributes with default settings.

template<class TKey, class TValue>
RegionAttributes<TKey, TValue> ^ GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::CreateRegionAttributes (  ) 

Creates a RegionAttributes with the current settings.

Returns:
the newly created RegionAttributes
Exceptions:
IllegalStateException if the current settings violate the compatibility rules.

void GemStone::GemFire::Cache::Generic::Internal::UMWrap< gemfire::AttributesFactory >::InternalCleanup (  )  [inline, protected, inherited]

Internal cleanup function invoked by dispose/finalizer.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCacheListener ( String^   libPath,
String^   factoryFunctionName 
)

Sets the library path for the library that will be invoked for the listener of the region.

Parameters:
libPath library pathname containing the factory function.
factoryFunctionName Name of factory function that creates a CacheListener for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an ICacheListener for a managed library.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCacheListener ( ICacheListener< TKey, TValue >^  cacheListener  ) 

Sets the CacheListener for the RegionAttributes being created.

Parameters:
cacheListener user-defined cache listener, or null for no cache listener

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCacheLoader ( String^   libPath,
String^   factoryFunctionName 
)

Sets the library path for the library that will be invoked for the loader of the region.

Parameters:
libPath library pathname containing the factory function.
factoryFunctionName Name of factory function that creates a CacheLoader for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an ICacheLoader for a managed library.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCacheLoader ( ICacheLoader< TKey, TValue >^  cacheLoader  ) 

Sets the cache loader for the RegionAttributes being created.

Parameters:
cacheLoader a user-defined cache loader, or null for no cache loader

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCacheWriter ( String^   libPath,
String^   factoryFunctionName 
)

Sets the library path for the library that will be invoked for the writer of the region.

Parameters:
libPath library pathname containing the factory function.
factoryFunctionName Name of factory function that creates a CacheWriter for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an ICacheWriter for a managed library.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCacheWriter ( ICacheWriter< TKey, TValue >^  cacheWriter  ) 

Sets the cache writer for the RegionAttributes being created.

Parameters:
cacheWriter user-defined cache writer, or null for no cache writer

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCachingEnabled ( bool  cachingEnabled  ) 

Set caching enabled flag for this region.

If set to false, then no data is stored in the local process, but events and distributions will still occur, and the region can still be used to put and remove, etc...

The default if not set is 'true', 'false' is illegal for regions of ScopeType.Local scope.

Parameters:
cachingEnabled if true, cache data for this region in this process.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetClientNotificationEnabled ( bool  clientNotificationEnabled  ) 

Enables/disables client noficiations for a Thin client region.

Parameters:
clientNotificationEnabled true if client notifications have to be enabled; false otherwise

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetCloningEnabled ( bool  cloningEnabled  ) 

Set cloning enabled flag for this region.

If set to false, then there is no cloning will take place in case of delta. Delta will be applied on the old value which will change old value in-place.

The default if not set is 'false' of ScopeType.Local scope.

Parameters:
cloningEnabled if true, clone old value before applying delta so that in-place change would not occour..

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetConcurrencyChecksEnabled ( bool  concurrencyChecksEnabled  ) 

Sets concurrency checks enabled flag for this region.

If set to false, then the version checks will not occur.

The default if not set is 'true'

Parameters:
concurrencyChecksEnabled if true, version checks for region entries will occur.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetConcurrencyLevel ( int32_t  concurrencyLevel  ) 

Sets the concurrency level of the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
concurrencyLevel the concurrency level of the entry map
Exceptions:
IllegalArgumentException if concurrencyLevel is nonpositive

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetDiskPolicy ( DiskPolicyType  diskPolicy  ) 

Sets the disk policy type for the next RegionAttributes created.

Parameters:
diskPolicy the disk policy to use for the region

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetEndpoints ( String^   endpoints  ) 

Set the endpoints for a Thin Client region.

If the endpoints are set then the region is taken to be a Thin-client region that interacts with the GemFire Java cacheserver.

Parameters:
endpoints The list of host:port pairs separated by commas.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetEntryIdleTimeout ( ExpirationAction  action,
uint32_t  idleTimeout 
)

Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created.

Parameters:
action The expiration action for which to set the timeout.
idleTimeout the idleTimeout in seconds for entries in this region.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetEntryTimeToLive ( ExpirationAction  action,
uint32_t  timeToLive 
)

Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created.

Parameters:
action The expiration action for which to set the timeout.
timeToLive the timeToLive in seconds for entries in this region.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetInitialCapacity ( int32_t  initialCapacity  ) 

Sets the entry initial capacity for the RegionAttributes being created. This value is used in initializing the map that holds the entries.

Parameters:
initialCapacity the initial capacity of the entry map
Exceptions:
IllegalArgumentException if initialCapacity is nonpositive

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetLoadFactor ( Single  loadFactor  ) 

Sets the entry load factor for the next RegionAttributes created. This value is used in initializing the map that holds the entries.

Parameters:
loadFactor the load factor of the entry map
Exceptions:
IllegalArgumentException if loadFactor is nonpositive

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetLruEntriesLimit ( uint32_t  entriesLimit  ) 

Sets a limit on the number of entries that will be held in the cache. If a new entry is added while at the limit, the cache will evict the least recently used entry.

Parameters:
entriesLimit The limit of the number of entries before eviction starts. Defaults to 0, meaning no LRU actions will used.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetPartitionResolver ( String^   libPath,
String^   factoryFunctionName 
)

Sets the library path for the library that will be invoked for the partition resolver of the region.

Parameters:
libPath library pathname containing the factory function.
factoryFunctionName Name of factory function that creates a PartitionResolver for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an IPartitionResolver for a managed library.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetPartitionResolver ( IPartitionResolver< TKey, TValue >^  partitionresolver  ) 

Sets the PartitionResolver for the RegionAttributes being created.

Parameters:
partitionresolver user-defined partition resolver, or null for no partition resolver

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetPersistenceManager ( String^   libPath,
String^   factoryFunctionName,
Properties< String^ , String^ >^  config 
)

Sets the library path for the library that will be invoked for the persistence of the region. If the region is being created from a client on a server, or on a server directly, then This must be used to set the PersistenceManager.

Parameters:
libPath The path of the PersistenceManager shared library.
factoryFunctionName The name of the factory function to create an instance of PersistenceManager object.
config The configuration properties to use for the PersistenceManager.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetPersistenceManager ( String^   libPath,
String^   factoryFunctionName 
)

Sets the library path for the library that will be invoked for the persistence of the region. If the region is being created from a client on a server, or on a server directly, then This must be used to set the PersistenceManager.

Parameters:
libPath The path of the PersistenceManager shared library.
factoryFunctionName The name of the factory function to create an instance of PersistenceManager object.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetPersistenceManager ( IPersistenceManager< TKey, TValue >^  persistenceManager,
Properties< String^ , String^ >^  config 
)

Sets the PersistenceManager object that will be invoked for the persistence of the region.

Parameters:
persistenceManager Persistence Manager object
config The configuration properties to use for the PersistenceManager.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetPersistenceManager ( IPersistenceManager< TKey, TValue >^  persistenceManager  ) 

Sets the PersistenceManager object that will be invoked for the persistence of the region.

Parameters:
persistenceManager Persistence Manager object

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetPoolName ( String^   poolName  ) 

Set the pool name for a Thin Client region.

The pool with the name specified must be already created.

Parameters:
poolName The name of the pool to attach to this region.

void GemStone::GemFire::Cache::Generic::Internal::UMWrap< gemfire::AttributesFactory >::SetPtr ( gemfire::AttributesFactory *  nativeptr,
bool  own 
) [inline, protected, inherited]

Used to set the native pointer to a new object. This should only be used when you know that the underlying object is NULL or you do not own it.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetRegionIdleTimeout ( ExpirationAction  action,
uint32_t  idleTimeout 
)

Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created.

Parameters:
action The expiration action for which to set the timeout.
idleTimeout the idleTimeout in seconds for the region as a whole.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetRegionTimeToLive ( ExpirationAction  action,
uint32_t  timeToLive 
)

Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created.

Parameters:
action The expiration action for which to set the timeout.
timeToLive the timeToLive in seconds for the region as a whole.

template<class TKey, class TValue>
void GemStone::GemFire::Cache::Generic::AttributesFactory< TKey, TValue >::SetScope ( ScopeType  scopeType  ) 

Sets the scope for the next RegionAttributes created.

Parameters:
scopeType the type of scope to use for the region


Property Documentation

bool GemStone::GemFire::Cache::Generic::Internal::UMWrap< gemfire::AttributesFactory >::Own [get, set, protected, inherited]

Get or set the ownership of this object.

Returns:
True if the native object is owned by this object.


GemFire C++ Cache .NET API Documentation