00001 #ifndef __GEMFIRE_PERSISTENCEMANAGER_H__ 00002 #define __GEMFIRE_PERSISTENCEMANAGER_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 #include "gfcpp_globals.hpp" 00009 #include "gf_types.hpp" 00010 #include "DistributedSystem.hpp" 00011 #include "ExceptionTypes.hpp" 00012 #include "CacheableKey.hpp" 00013 #include "Cacheable.hpp" 00014 00019 namespace gemfire { 00020 00021 00022 typedef PersistenceManagerPtr (*getPersistenceManagerInstance) (const RegionPtr&); 00023 00030 class CPPCACHE_EXPORT PersistenceManager: public SharedBase { 00034 public: 00035 00036 00041 static PersistenceManagerPtr getPersistenceManager(); 00042 00053 virtual void write(const CacheableKeyPtr& key, const CacheablePtr& value, void *& PersistenceInfo)=0; 00054 00055 00060 virtual bool writeAll()=0; 00061 00067 virtual void init(const RegionPtr& region, PropertiesPtr& diskProperties)=0; 00068 00069 00077 virtual CacheablePtr read(const CacheableKeyPtr& key, void *& PersistenceInfo)=0; 00078 00079 00084 virtual bool readAll()=0; 00085 00086 00093 //virtual void invalidate(const CacheableKeyPtr& key)=0; 00094 00095 00103 virtual void destroy(const CacheableKeyPtr& key, void *& PersistenceInfo)=0; 00104 00109 virtual void close()=0; 00110 00114 //virtual int numEntries()const=0; 00115 00116 PersistenceManager(const RegionPtr& regionPtr); 00117 PersistenceManager(); 00121 virtual ~PersistenceManager() = 0; 00122 //m_regionPtr = NULL; 00123 //} 00124 protected: 00127 const RegionPtr m_regionPtr; 00128 00129 }; 00130 00131 }; //namespace gemfire 00132 #endif //ifndef __GEMFIRE_PERSISTENCEMANAGER_H__