E:/gfcppsancout/product/include/gfcpp/SystemProperties.hpp

Go to the documentation of this file.
00001 #ifndef _GEMFIRE_SYSTEMPROPERTIES_HPP_
00002 #define _GEMFIRE_SYSTEMPROPERTIES_HPP_
00003 
00004 
00005 /*=========================================================================
00006  * (c) Copyright 2004-2007, GemStone Systems, Inc. All Rights Reserved.
00007  * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00008  *=========================================================================
00009  */
00010 
00011 
00012 #include "Properties.hpp"
00013 #include "Log.hpp"
00014 #include "AuthInitialize.hpp"
00015 
00019 namespace gemfire {
00020 
00021 
00028 // Factory function typedefs to register the managed authInitialize
00029 typedef AuthInitialize* ( *LibraryAuthInitializeFn ) ( const char* assemblyPath,
00030                                                  const char* factFuncName );
00031 
00038 class CPPCACHE_EXPORT SystemProperties {
00039 
00040 public:
00041 
00042 
00050   SystemProperties(const PropertiesPtr& propertiesPtr,
00051       const char* configFile = NULL);
00052 
00053 
00057   ~SystemProperties();
00058 
00060   void logSettings( );
00061 
00062   const uint32_t threadPoolSize() const
00063   { return m_threadPoolSize; }
00064 
00065 
00070   const uint32_t statisticsSampleInterval() const
00071     { return m_statisticsSampleInterval; }
00072 
00073 
00077   bool statisticsEnabled() const
00078     { return m_statisticsEnabled; }
00079 
00083   bool sslEnabled() const
00084     { return m_sslEnabled; }
00085 
00089     bool getEnableTimeStatistics() const /*timestatisticsEnabled()*/
00090       { return m_timestatisticsEnabled; } /*m_timestatisticsEnabled*/
00091 
00095   const char* sslKeyStore() const
00096     { return m_sslKeyStore; }
00097 
00101   const char* sslKeystorePassword() const
00102     { return m_sslKeystorePassword; }
00103 
00107   const char* sslTrustStore() const
00108     { return m_sslTrustStore; }
00109 
00110 
00115   const char* statisticsArchiveFile() const
00116     { return m_statisticsArchiveFile; }
00117 
00118 
00123   const char* logFilename() const
00124     { return m_logFilename; }
00125 
00126 
00130   Log::LogLevel logLevel() const
00131     { return m_logLevel; }
00132 
00141   const bool heapLRULimitEnabled() const
00142   { return (m_heapLRULimit > 0); }
00143 
00151     const size_t heapLRULimit() const
00152     { return m_heapLRULimit; }
00153 
00154 
00160       const int32_t heapLRUDelta() const
00161       { return m_heapLRUDelta; }
00165   const int32_t maxSocketBufferSize() const { return m_maxSocketBufferSize; }
00166 
00170   const int32_t pingInterval() const { return m_pingInterval; }
00174   const int32_t redundancyMonitorInterval() const { return m_redundancyMonitorInterval; }
00175 
00179   const int32_t notifyAckInterval() const { return m_notifyAckInterval; }
00180 
00184   const int32_t notifyDupCheckLife() const { return m_notifyDupCheckLife; }
00185 
00189   const char* durableClientId() const { return m_durableClientId; }
00190 
00194   const uint32_t durableTimeout() const { return m_durableTimeout; }
00195 
00199   const uint32_t connectTimeout() const { return m_connectTimeout; }
00200 
00204   char* conflateEvents(){ return m_conflateEvents; }
00205 
00209   const bool debugStackTraceEnabled() const
00210     { return m_debugStackTraceEnabled; }
00211 
00221   inline const bool crashDumpEnabled() const
00222   {
00223     return m_crashDumpEnabled;
00224   }
00225 
00226   const char* name() const
00227      {return m_name;}
00228 
00229   const char* cacheXMLFile() const
00230      {return m_cacheXMLFile;}
00231 
00235   const uint32_t logFileSizeLimit() const
00236      {return m_logFileSizeLimit;}
00237 
00241   const uint32_t logDiskSpaceLimit() const
00242      {return m_logDiskSpaceLimit;}
00243 
00247   const uint32_t statsFileSizeLimit() const
00248      {return m_statsFileSizeLimit;}
00249 
00253   const uint32_t statsDiskSpaceLimit() const
00254      {return m_statsDiskSpaceLimit;}
00255 
00256   const uint32_t maxQueueSize()
00257      {return m_maxQueueSize;}
00258 
00259   const uint32_t javaConnectionPoolSize() const
00260      { return m_javaConnectionPoolSize;}
00261   void setjavaConnectionPoolSize(uint32_t size) {
00262     m_javaConnectionPoolSize = size ;
00263   }
00264 
00268   bool disableChunkHandlerThread() const
00269   {
00270     return m_disableChunkHandlerThread;
00271   }
00272 
00276   void setDisableChunkHandlerThread(bool set) {
00277     m_disableChunkHandlerThread = set ;
00278   }
00279 
00281   inline const char* authInitLibrary() const
00282   {
00283     return (m_AuthIniLoaderLibrary == NULLPTR ? "" :
00284         m_AuthIniLoaderLibrary->asChar());
00285   }
00286 
00288   inline const char* authInitFactory() const
00289   {
00290     return (m_AuthIniLoaderFactory == NULLPTR ? "" :
00291         m_AuthIniLoaderFactory->asChar());
00292   }
00293 
00295   const char* securityClientDhAlgo( ) {
00296     return (m_securityClientDhAlgo == NULLPTR ? "" :
00297     m_securityClientDhAlgo->asChar());
00298   }
00299 
00301   const char* securityClientKsPath( ) {
00302     return (m_securityClientKsPath == NULLPTR ? "" :
00303     m_securityClientKsPath->asChar());
00304   }
00305 
00309   PropertiesPtr getSecurityProperties() const
00310   {
00311     return m_securityPropertiesPtr;
00312   }
00313 
00317   inline bool isSecurityOn() const
00318   {
00319     return (m_AuthIniLoaderFactory != NULLPTR &&
00320         m_AuthIniLoaderLibrary != NULLPTR);
00321   }
00322 
00326   inline bool isEndpointShufflingDisabled() const
00327   {
00328     return m_disableShufflingEndpoint;
00329   }
00330 
00335   bool isDhOn() {
00336     return isSecurityOn() && m_securityClientDhAlgo != NULLPTR &&
00337         m_securityClientDhAlgo->length() > 0;
00338   }
00339 
00355   inline bool isGridClient() const
00356   {
00357     return m_gridClient;
00358   }
00359 
00364   inline bool isAppDomainEnabled() const
00365   {
00366     return m_appDomainEnabled;
00367   }
00368 
00378   inline bool autoReadyForEvents() const
00379   {
00380     return m_autoReadyForEvents;
00381   }
00382 
00386   const uint32_t suspendedTxTimeout() const { return m_suspendedTxTimeout; }
00387 
00391   const uint32_t tombstoneTimeoutInMSec() const { return m_tombstoneTimeoutInMSec; }
00392 
00393 private:
00394 
00395   uint32_t m_statisticsSampleInterval;
00396 
00397   bool m_statisticsEnabled;
00398 
00399   bool m_appDomainEnabled;
00400 
00401   char* m_statisticsArchiveFile;
00402 
00403   char* m_logFilename;
00404 
00405   Log::LogLevel m_logLevel;
00406 
00407   int m_sessions;
00408 
00409   char* m_name;
00410 
00411   bool m_debugStackTraceEnabled;
00412 
00413   bool m_crashDumpEnabled;
00414 
00415   bool m_disableShufflingEndpoint;
00416 
00417   char* m_cacheXMLFile;
00418 
00419   uint32_t m_logFileSizeLimit;
00420   uint32_t m_logDiskSpaceLimit;
00421 
00422   uint32_t m_statsFileSizeLimit;
00423   uint32_t m_statsDiskSpaceLimit;
00424 
00425   uint32_t m_maxQueueSize;
00426   uint32_t m_javaConnectionPoolSize;
00427 
00428   int32_t m_heapLRULimit;
00429   int32_t m_heapLRUDelta;
00430   int32_t m_maxSocketBufferSize;
00431   int32_t m_pingInterval;
00432   int32_t m_redundancyMonitorInterval;
00433 
00434   int32_t m_notifyAckInterval;
00435   int32_t m_notifyDupCheckLife;
00436 
00437 
00438 
00439   PropertiesPtr m_securityPropertiesPtr;
00440   CacheableStringPtr m_AuthIniLoaderLibrary;
00441   CacheableStringPtr m_AuthIniLoaderFactory;
00442   CacheableStringPtr m_securityClientDhAlgo;
00443   CacheableStringPtr m_securityClientKsPath;
00444   AuthInitializePtr  m_authInitializer;
00445 
00446   char * m_durableClientId;
00447   uint32_t m_durableTimeout;
00448 
00449   uint32_t m_connectTimeout;
00450 
00451   bool m_gridClient;
00452 
00453   bool m_autoReadyForEvents;
00454 
00455   bool m_sslEnabled;
00456   bool m_timestatisticsEnabled;
00457   char * m_sslKeyStore;
00458   char * m_sslTrustStore;
00459 
00460   char *m_sslKeystorePassword;
00461 
00462   char * m_conflateEvents;
00463 
00464   uint32_t m_threadPoolSize;
00465   uint32_t m_suspendedTxTimeout;
00466   uint32_t m_tombstoneTimeoutInMSec;
00467   bool m_disableChunkHandlerThread;
00468 private:
00469 
00470 
00475    void processProperty( const char* property, const char* value );
00476 
00482   AuthInitializePtr getAuthLoader() ;
00483 
00484 private:
00485   SystemProperties(const SystemProperties& rhs); // never defined
00486   void operator = (const SystemProperties& rhs); // never defined
00487 
00488   void throwError( const char* msg );
00489 
00490 public:
00491   static LibraryAuthInitializeFn managedAuthInitializeFn;
00492   static LibraryAuthInitializeFn managedAuthInitializeFnGeneric;
00493 
00494 friend class DistributedSystemImpl;
00495 };
00496 
00497 
00498 } // namespace
00499 
00500 
00501 #endif

GemFire C++ Cache API Documentation