/export/rook1/users/build/gfcppsancout64/product/include/gfcpp/RegionFactory.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_REGIONFACTORY_H__
00002 #define __GEMFIRE_REGIONFACTORY_H__
00003 /*=========================================================================
00004  * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved.
00005  * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00006  *========================================================================
00007  */
00008 
00009 #include "gfcpp_globals.hpp"
00010 #include "gf_types.hpp"
00011 #include "AttributesFactory.hpp"
00016 namespace gemfire {
00017   class CacheImpl;
00018 class CPPCACHE_EXPORT RegionFactory: public SharedBase{
00019   public:
00020 
00021  /*
00022   * To create the (@link Region}.
00023   * @param name
00024   *        the name of the Region.
00025   * @throws RegionExistsException if a region is already in
00026   * this cache
00027   * @throws CacheClosedException if the cache is closed
00028   */
00029   RegionPtr create(const char* name);
00030     
00035   RegionFactoryPtr setCacheLoader(const CacheLoaderPtr& cacheLoader);
00036 
00041   RegionFactoryPtr setCacheWriter(const CacheWriterPtr& cacheWriter);
00042 
00047   RegionFactoryPtr setCacheListener(const CacheListenerPtr& aListener);
00048 
00053   RegionFactoryPtr setPartitionResolver(const PartitionResolverPtr& aResolver);
00054 
00059   RegionFactoryPtr setCacheLoader(const char* libpath, const char* factoryFuncName);
00060 
00065   RegionFactoryPtr setCacheWriter(const char* libpath, const char* factoryFuncName);
00066 
00071   RegionFactoryPtr setCacheListener(const char* libpath, const char* factoryFuncName);
00072 
00077   RegionFactoryPtr setPartitionResolver(const char* libpath, const char* factoryFuncName);
00078 
00079   // EXPIRATION ATTRIBUTES
00080 
00087   RegionFactoryPtr setEntryIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
00088 
00095   RegionFactoryPtr setEntryTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
00096 
00097 
00104   RegionFactoryPtr setRegionIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
00105 
00112   RegionFactoryPtr setRegionTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
00113 
00114   // PERSISTENCE
00121   RegionFactoryPtr setPersistenceManager(const char* libpath, const char* factoryFuncName,
00122       const PropertiesPtr& config = NULLPTR);
00123 
00124   // MAP ATTRIBUTES
00132   RegionFactoryPtr setInitialCapacity( int initialCapacity);
00133 
00141   RegionFactoryPtr setLoadFactor( float loadFactor);
00142 
00149   RegionFactoryPtr setConcurrencyLevel(uint8_t concurrencyLevel);
00150 
00159   RegionFactoryPtr setLruEntriesLimit( const uint32_t entriesLimit );
00160 
00166   RegionFactoryPtr setDiskPolicy(const DiskPolicyType::PolicyType diskPolicy);
00167 
00177    RegionFactoryPtr setCachingEnabled( bool cachingEnabled );
00178 
00179   /*
00180    * Set the PoolName to attach the Region with that Pool.
00181    * Use only when Cache ha more than one Pool
00182    * @param name 
00183    *        the name of the Pool to which region will be attached. 
00184    * @return a reference to <code>this</code>
00185    */
00186    RegionFactoryPtr setPoolName( const char * name );
00187 
00188   /*
00189    * Set boolean to enable/disable cloning while applying delta.
00190    * @param isClonable whether to enable cloning or not.
00191    * @return a reference to <code>this</code>
00192    */
00193    RegionFactoryPtr setCloningEnabled( bool isClonable );
00194     
00195   private :
00196     RegionFactory(gemfire::RegionShortcut preDefinedRegion);
00197 
00198     RegionShortcut m_preDefinedRegion;
00199 
00200     AttributesFactoryPtr m_attributeFactory;
00201 
00202     void setRegionShortcut();
00203 
00204   ~RegionFactory();
00205   friend class CacheImpl;
00206 };
00207 }; //namespace gemfire
00208 
00209 #endif //ifndef __GEMFIRE_REGIONFACTORY_H__

GemFire C++ Cache API Documentation