當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。