1 #ifndef ISPN_HOTROD_REMOTECACHEMANAGER_H 2 #define ISPN_HOTROD_REMOTECACHEMANAGER_H 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 transactionTable, forceReturnValue,
121 getConfiguration().isTransactional());
123 initCache(*rcache, forceReturnValue, getConfiguration().getNearCacheConfiguration());
128 remoteCacheMap[key] = std::unique_ptr<RemoteCacheBase>(rcache);
145 return getCache<K,V>(getConfiguration().isForceReturnValue());
156 const std::string &name,
bool forceReturnValue) {
157 const std::string key =
158 forceReturnValue ? name +
"/true" : name +
"/false";
159 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
161 transactionTable, forceReturnValue,
162 getConfiguration().isTransactional());
164 initCache(*rcache, name.c_str(), forceReturnValue);
169 remoteCacheMap[key] = std::unique_ptr<RemoteCacheBase >(rcache);
186 const std::string& name) {
187 return getCache<K,V>(name, getConfiguration().isForceReturnValue());
203 const std::string key = forceReturnValue ?
"/true" :
"/false";
204 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
206 transactionTable, forceReturnValue,
207 getConfiguration().isTransactional());
209 initCache(*rcache, forceReturnValue,
210 getConfiguration().getNearCacheConfiguration());
215 remoteCacheMap[key] = std::unique_ptr<RemoteCacheBase>(rcache);
218 cache->keyMarshaller.reset(km);
219 cache->valueMarshaller.reset(vm);
239 return getCache<K,V>(km, kd, vm, vd, getConfiguration().isForceReturnValue());
255 bool forceReturnValue) {
256 const std::string key =
257 forceReturnValue ? name +
"/true" : name +
"/false";
258 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
260 transactionTable, forceReturnValue,
261 getConfiguration().isTransactional());
263 initCache(*rcache, name.c_str(), forceReturnValue,
264 getConfiguration().getNearCacheConfiguration());
269 remoteCacheMap[key] = std::unique_ptr<RemoteCacheBase >(rcache);
272 cache->keyMarshaller.reset(km);
273 cache->valueMarshaller.reset(vm);
290 const std::string& name) {
291 return getCache(km, kd, vm, vd, name, getConfiguration().isForceReturnValue());
299 bool switchToDefaultCluster();
307 bool switchToCluster(std::string clusterName);
317 return newRemoteCacheManagerAdmin();
320 std::set<std::string> getCacheNames();
323 return transactionManager;
328 std::map<std::string, std::unique_ptr<RemoteCacheBase> > remoteCacheMap;
329 std::function<void(std::string&)> cacheRemover;
333 void init(
const std::map<std::string, std::string>& configuration,
bool start);
342 std::shared_ptr<RemoteCacheManagerAdmin> newRemoteCacheManagerAdmin();
344 template<
typename T>
static void genericDelete(T *t) {
delete t; }
345 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:236
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), bool forceReturnValue)
Definition: RemoteCacheManager.h:200
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:287
Definition: NearCacheConfiguration.h:32
RemoteCache< K, V > & getCache()
Definition: RemoteCacheManager.h:144
RemoteCache< K, V > & getCache(const std::string &name)
Definition: RemoteCacheManager.h:185
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:316
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:252
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:155
Definition: RemoteCacheManagerAdmin.h:39
Definition: Marshaller.h:12
Definition: TransactionManager.h:69
TransactionManager & getTransactionManager() const
Definition: RemoteCacheManager.h:321