本文整理匯總了Java中org.infinispan.manager.EmbeddedCacheManager.cacheExists方法的典型用法代碼示例。如果您正苦於以下問題:Java EmbeddedCacheManager.cacheExists方法的具體用法?Java EmbeddedCacheManager.cacheExists怎麽用?Java EmbeddedCacheManager.cacheExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.infinispan.manager.EmbeddedCacheManager
的用法示例。
在下文中一共展示了EmbeddedCacheManager.cacheExists方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getCacheProperties
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public Properties getCacheProperties(String containerName, String cacheName) {
EmbeddedCacheManager manager = this.cm;
if (manager == null) {
return null;
}
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (!manager.cacheExists(realCacheName)) {
return null;
}
Configuration conf = manager.getCache(realCacheName).getAdvancedCache()
.getCacheConfiguration();
Properties p = new Properties();
p.setProperty(IClusterServices.cacheProps.TRANSACTION_PROP.toString(),
conf.transaction().toString());
p.setProperty(IClusterServices.cacheProps.CLUSTERING_PROP.toString(),
conf.clustering().toString());
p.setProperty(IClusterServices.cacheProps.LOCKING_PROP.toString(), conf
.locking().toString());
return p;
}
示例2: addListener
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public void addListener(String containerName, String cacheName,
IGetUpdates<?, ?> u) throws CacheListenerAddException {
EmbeddedCacheManager manager = this.cm;
Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return;
}
if (!manager.cacheExists(realCacheName)) {
throw new CacheListenerAddException();
}
c = manager.getCache(realCacheName);
CacheListenerContainer cl = new CacheListenerContainer(u,
containerName, cacheName);
c.addListener(cl);
}
示例3: getListeners
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public Set<IGetUpdates<?, ?>> getListeners(String containerName,
String cacheName) {
EmbeddedCacheManager manager = this.cm;
Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return null;
}
if (!manager.cacheExists(realCacheName)) {
return null;
}
c = manager.getCache(realCacheName);
Set<IGetUpdates<?, ?>> res = new HashSet<IGetUpdates<?, ?>>();
Set<Object> listeners = c.getListeners();
for (Object listener : listeners) {
if (listener instanceof CacheListenerContainer) {
CacheListenerContainer cl = (CacheListenerContainer) listener;
res.add(cl.whichListener());
}
}
return res;
}
示例4: removeListener
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public void removeListener(String containerName, String cacheName,
IGetUpdates<?, ?> u) {
EmbeddedCacheManager manager = this.cm;
Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return;
}
if (!manager.cacheExists(realCacheName)) {
return;
}
c = manager.getCache(realCacheName);
Set<Object> listeners = c.getListeners();
for (Object listener : listeners) {
if (listener instanceof CacheListenerContainer) {
CacheListenerContainer cl = (CacheListenerContainer) listener;
if (cl.whichListener() == u) {
c.removeListener(listener);
return;
}
}
}
}
示例5: createCache
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public ConcurrentMap<?, ?> createCache(String containerName,
String cacheName, Set<cacheMode> cMode) throws CacheExistException,
CacheConfigException {
EmbeddedCacheManager manager = this.cm;
Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return null;
}
if (manager.cacheExists(realCacheName)) {
throw new CacheExistException();
}
// Sanity check to avoid contrasting parameters
if (cMode.containsAll(EnumSet.of(
IClusterServices.cacheMode.NON_TRANSACTIONAL,
IClusterServices.cacheMode.TRANSACTIONAL))) {
throw new CacheConfigException();
}
if (cMode.contains(IClusterServices.cacheMode.NON_TRANSACTIONAL)) {
c = manager.getCache(realCacheName);
return c;
} else if (cMode.contains(IClusterServices.cacheMode.TRANSACTIONAL)) {
Configuration rc = manager
.getCacheConfiguration("transactional-type");
manager.defineConfiguration(realCacheName, rc);
c = manager.getCache(realCacheName);
return c;
}
return null;
}
示例6: getCache
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public ConcurrentMap<?, ?> getCache(String containerName, String cacheName) {
EmbeddedCacheManager manager = this.cm;
Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return null;
}
if (manager.cacheExists(realCacheName)) {
c = manager.getCache(realCacheName);
return c;
}
return null;
}
示例7: destroyCache
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public void destroyCache(String containerName, String cacheName) {
EmbeddedCacheManager manager = this.cm;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return;
}
if (manager.cacheExists(realCacheName)) {
manager.removeCache(realCacheName);
}
}
示例8: existCache
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Override
public boolean existCache(String containerName, String cacheName) {
EmbeddedCacheManager manager = this.cm;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return false;
}
return manager.cacheExists(realCacheName);
}