当前位置: 首页>>代码示例>>Java>>正文


Java EmbeddedCacheManager.cacheExists方法代码示例

本文整理汇总了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;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:22,代码来源:ClusterManager.java

示例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);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:19,代码来源:ClusterManager.java

示例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;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:27,代码来源:ClusterManager.java

示例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;
            }
        }
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:27,代码来源:ClusterManager.java

示例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;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:35,代码来源:ClusterManager.java

示例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;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:16,代码来源:ClusterManager.java

示例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);
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:12,代码来源:ClusterManager.java

示例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);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:10,代码来源:ClusterManager.java


注:本文中的org.infinispan.manager.EmbeddedCacheManager.cacheExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。