1 #ifndef ISPN_HOTROD_REMOTECACHEMANAGER_H 2 #define ISPN_HOTROD_REMOTECACHEMANAGER_H 16 class RemoteCacheManagerImpl;
52 const std::map<std::string, std::string>& configuration,
54 init(configuration, start_);
110 bool forceReturnValue) {
111 const std::string key = forceReturnValue ?
"/true" :
"/false";
112 if (remoteCacheMap.find(key)==remoteCacheMap.end())
116 remoteCacheMap[key]= std::unique_ptr<RemoteCacheBase>(pRc);
120 initCache(*rcache, forceReturnValue, getConfiguration().getNearCacheConfiguration());
146 const std::string& name,
bool forceReturnValue) {
147 const std::string key = forceReturnValue ? name+
"/true" : name+
"/false";
148 if (remoteCacheMap.find(key)==remoteCacheMap.end())
151 remoteCacheMap[key]= std::unique_ptr<RemoteCacheBase>(pRc);
155 initCache(*rcache, name.c_str(), forceReturnValue);
170 const std::string& name) {
187 const std::string key = forceReturnValue ?
"/true" :
"/false";
188 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
190 remoteCacheMap[key] = std::unique_ptr < RemoteCacheBase > (pRc);
194 rcache->keyMarshaller.reset(km);
195 rcache->valueMarshaller.reset(vm);
196 initCache(*rcache, forceReturnValue, getConfiguration().getNearCacheConfiguration());
232 const std::string& name,
bool forceReturnValue) {
233 const std::string key = forceReturnValue ? name+
"/true" : name+
"/false";
234 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
236 remoteCacheMap[key] = std::unique_ptr < RemoteCacheBase > (pRc);
240 rcache->keyMarshaller.reset(km);
241 rcache->valueMarshaller.reset(vm);
259 const std::string& name) {
260 return getCache(km, kd, vm, vd, name, getConfiguration().isForceReturnValue());
268 bool switchToDefaultCluster();
276 bool switchToCluster(std::string clusterName);
280 std::map<std::string, std::unique_ptr<RemoteCacheBase> > remoteCacheMap;
282 void init(
const std::map<std::string, std::string>& configuration,
bool start);
291 template<
typename T>
static void genericDelete(T *t) {
delete t; }
292 template<
typename T>
static void genericNoDelete(T *) { }
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *))
Definition: RemoteCacheManager.h:213
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), bool forceReturnValue)
Definition: RemoteCacheManager.h:184
const NearCacheConfiguration & getNearCacheConfiguration() const
Definition: Configuration.h:195
#define HR_EXTERN
Definition: ImportExport.h:35
RemoteCacheManager(const std::map< std::string, std::string > &configuration, bool start_=true)
Definition: RemoteCacheManager.h:51
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), const std::string &name)
Definition: RemoteCacheManager.h:256
Definition: NearCacheConfiguration.h:32
RemoteCache< K, V > & getCache()
Definition: RemoteCacheManager.h:134
RemoteCache< K, V > & getCache(const std::string &name)
Definition: RemoteCacheManager.h:169
Definition: CacheClientListener.h:28
RemoteCache< K, V > & getCache(bool forceReturnValue)
Definition: RemoteCacheManager.h:109
Definition: AuthenticationConfiguration.h:10
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), const std::string &name, bool forceReturnValue)
Definition: RemoteCacheManager.h:229
HR_EXTERN const bool & isForceReturnValue() const
Definition: Configuration.h:28
Definition: RemoteCacheManager.h:38
Definition: BasicMarshaller.h:18
RemoteCache< K, V > & getCache(const std::string &name, bool forceReturnValue)
Definition: RemoteCacheManager.h:145
Definition: Marshaller.h:12