1 #ifndef ISPN_HOTROD_REMOTECACHEMANAGER_H
2 #define ISPN_HOTROD_REMOTECACHEMANAGER_H
17 namespace infinispan {
20 class RemoteCacheManagerImpl;
57 const std::map<std::string, std::string>& configuration,
59 init(configuration, start_);
115 bool forceReturnValue) {
116 const std::string key = forceReturnValue ?
"/true" :
"/false";
117 if (remoteCacheMap.find(key)==remoteCacheMap.end())
120 pRc=
new RemoteCache<K,V>(transactionManager, transactionTable, forceReturnValue, getConfiguration().isTransactional());
121 remoteCacheMap[key]= std::unique_ptr<RemoteCacheBase>(pRc);
125 initCache(*rcache, forceReturnValue, getConfiguration().getNearCacheConfiguration());
140 return getCache<K,V>(getConfiguration().isForceReturnValue());
151 const std::string& name,
bool forceReturnValue) {
152 const std::string key = forceReturnValue ? name+
"/true" : name+
"/false";
153 if (remoteCacheMap.find(key)==remoteCacheMap.end())
156 remoteCacheMap[key]= std::unique_ptr<RemoteCacheBase>(pRc);
160 initCache(*rcache, name.c_str(), forceReturnValue);
175 const std::string& name) {
176 return getCache<K,V>(name, getConfiguration().isForceReturnValue());
192 const std::string key = forceReturnValue ?
"/true" :
"/false";
193 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
195 remoteCacheMap[key] = std::unique_ptr < RemoteCacheBase > (pRc);
199 rcache->keyMarshaller.reset(km);
200 rcache->valueMarshaller.reset(vm);
201 initCache(*rcache, forceReturnValue, getConfiguration().getNearCacheConfiguration());
221 return getCache<K,V>(km, kd, vm, vd, getConfiguration().isForceReturnValue());
237 const std::string& name,
bool forceReturnValue) {
238 const std::string key = forceReturnValue ? name+
"/true" : name+
"/false";
239 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
241 remoteCacheMap[key] = std::unique_ptr < RemoteCacheBase > (pRc);
245 rcache->keyMarshaller.reset(km);
246 rcache->valueMarshaller.reset(vm);
247 initCache(*rcache, name.c_str(), forceReturnValue, getConfiguration().getNearCacheConfiguration());
264 const std::string& name) {
265 return getCache(km, kd, vm, vd, name, getConfiguration().isForceReturnValue());
273 bool switchToDefaultCluster();
281 bool switchToCluster(std::string clusterName);
291 return newRemoteCacheManagerAdmin();
294 std::set<std::string> getCacheNames();
297 return transactionManager;
302 std::map<std::string, std::unique_ptr<RemoteCacheBase> > remoteCacheMap;
303 std::function<void(std::string&)> cacheRemover;
307 void init(
const std::map<std::string, std::string>& configuration,
bool start);
316 std::shared_ptr<RemoteCacheManagerAdmin> newRemoteCacheManagerAdmin();
318 template<
typename T>
static void genericDelete(T *t) {
delete t; }
319 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:218
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), bool forceReturnValue)
Definition: RemoteCacheManager.h:189
Definition: Transactions.h:174
Definition: RemoteCounterManager.h:20
#define HR_EXTERN
Definition: ImportExport.h:35
RemoteCacheManager(const std::map< std::string, std::string > &configuration, bool start_=true)
Definition: RemoteCacheManager.h:56
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:261
Definition: NearCacheConfiguration.h:32
RemoteCache< K, V > & getCache()
Definition: RemoteCacheManager.h:139
RemoteCache< K, V > & getCache(const std::string &name)
Definition: RemoteCacheManager.h:174
Definition: TransactionManager.h:24
Definition: CacheClientListener.h:28
RemoteCache< K, V > & getCache(bool forceReturnValue)
Definition: RemoteCacheManager.h:114
std::shared_ptr< RemoteCacheManagerAdmin > administration()
Definition: RemoteCacheManager.h:290
TransactionManager & getTransactionManager() const
Definition: RemoteCacheManager.h:295
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:234
Definition: Configuration.h:28
Definition: RemoteCacheManager.h:43
Definition: BasicMarshaller.h:18
RemoteCache< K, V > & getCache(const std::string &name, bool forceReturnValue)
Definition: RemoteCacheManager.h:150
Definition: RemoteCacheManagerAdmin.h:39
Definition: Marshaller.h:12
Definition: TransactionManager.h:69