本文整理汇总了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);
}