org.infinispan.Cache.start()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中org.infinispan.Cache.start()方法的一些代码示例,展示了Cache.start()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.start()方法的具体详情如下:
包路径:org.infinispan.Cache
类名称:Cache
方法名:start

Cache.start介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

@Override
public Cache<K, V> get() {
  Cache<K, V> cache = this.container.get().getCache(this.cacheName);
  cache.start();
  return cache;
}

代码示例来源:origin: shopizer-ecommerce/shopizer

treeCache = f.createTreeCache(cache);
cache.start();

代码示例来源:origin: org.exoplatform.jcr/exo.jcr.component.core

public Object run()
  {
   cache.start();
   return null;
  }
};

代码示例来源:origin: it.rebase/rebot-karma-plugin

@Override
public void load() {
  cache.start();
  cache.addListener(karmaEventListener);
  log.fine("Plugin karma-plugin enabled.");
}

代码示例来源:origin: fr.inria.eventcloud/eventcloud-core

@Override
public void clear() {
  this.cache.stop();
  this.cache.start();
}

代码示例来源:origin: org.wildfly/wildfly-clustering-infinispan-spi

@Override
public Cache<K, V> get() {
  Cache<K, V> cache = this.container.get().getCache(this.cacheName);
  cache.start();
  return cache;
}

代码示例来源:origin: org.infinispan.server/infinispan-server-infinispan

public static <K, V> Cache<K, V> startCache(final EmbeddedCacheManager container, final String name, final String configurationName) {
  PrivilegedAction<Cache<K, V>> action = () -> {
    Cache<K, V> cache = container.getCache(name, configurationName);
    cache.start();
    return cache;
  };
  return doPrivileged(action);
}

代码示例来源:origin: org.restcomm.cluster/cache

public void startCache() {
  if (isStarted.compareAndSet(false, true)) {
    logger.info("Starting JBoss Cache " + name + " ...");
    this.cache.start();
    if (logger.isInfoEnabled()) {
      logger.info("Mobicents Cache  " + name + " started, status: " + cache.getStatus() + ", Mode: "
          + cache.getCacheConfiguration().clustering().cacheMode());
    }
  }
}

代码示例来源:origin: org.exoplatform.jcr/exo.jcr.component.core

public Cache<K, V> run()
  {
   Cache<K, V> cache = manager.getCache(regionIdEscaped);
   if (cache.getStatus() == ComponentStatus.TERMINATED)
   {
     cache.start();
     LOG.info("The cache corresponding to the region {} was in state Terminated, so it has been restarted",
      regionIdEscaped);
   }
   return cache;
  }
};

代码示例来源:origin: org.infinispan/infinispan-lucene-directory

@BeforeMethod
public void beforeTest() throws IOException {
 for (int i = 0; i < NUM_NODES; i++) {
   DefaultCacheManager node = new DefaultCacheManager(CONFIGURATION);
   node.start();
   //Start all its caches:
   node.getCache("index_metadata").start();
   node.getCache("index_data").start();
   node.getCache("index_locks").start();
   cacheManagers.put(i, node);
 }
}

代码示例来源:origin: org.picketlink.idm/picketlink-idm-cache

public void initialize(Cache infinispanCache, boolean attachLifespanToLeafNodes, long leafNodeLifespan, long staleNodesLinksCleanerDelay)
{
 this.cache = new IDMTreeCacheImpl(infinispanCache, attachLifespanToLeafNodes, leafNodeLifespan, staleNodesLinksCleanerDelay);
 ComponentStatus status = infinispanCache.getStatus();
 if (status.startAllowed())
 {
   this.cache.getCache().start();
 }
 log.info("Infinispan cache for Picketlink IDM created successfuly. cache name: " + cache.getCache().getName());
}

代码示例来源:origin: org.infinispan/infinispan-core

protected void startup() {
 long startTime = System.currentTimeMillis();
 log.warn("Starting cache");
 cache.start();
 long duration = System.currentTimeMillis() - startTime;
 log.warn("Started cache.  " + printDuration(duration));
}

代码示例来源:origin: org.projectodd.wunderboss/wunderboss-caching

@Override
public Cache find(String name) {
  Cache result = null;
  if (manager().isRunning(name)) {
    result = manager().getCache(name);
    if (!result.getStatus().allowInvocations()) {
      result.start();
    }
  }
  return result;
}

代码示例来源:origin: org.jboss.cluster/jboss-ha-server-cache-ispn

@Override
public void startService() throws Exception
{
 CacheContainer container = this.cacheHandler.getCacheContainer();
 this.cache = (this.cacheName != null) ? container.<Serializable, Serializable>getCache(this.cacheName) : container.<Serializable, Serializable>getCache();
 
 if (!this.cache.getStatus().allowInvocations())
 {
   this.cache.start();
 }
 
 this.cache.addListener(this);
}

代码示例来源:origin: org.infinispan/infinispan-query

@Test
public void testIndexingParametersForNamedCache() {
 Cache<Object, Object> inMemory = manager.getCache("memory-searchable");
 inMemory.start();
 assertFalse(inMemory.getCacheConfiguration().indexing().properties().isEmpty(),
    "should contain definition from xml");
}

代码示例来源:origin: org.infinispan/infinispan-core

@Test
public void testPreloadOnStart() throws PersistenceException {
 Cache<Object, Object> cache = caches().get(0);
 TestDeltaAware value = new TestDeltaAware();
 value.setFirstComponent("1st");
 value.setSecondComponent("2nd");
 cache.put(1, value);
 cache.stop();
 cache.start();
 TestDeltaAware deltaAware = (TestDeltaAware) cache.get(1);
 assertEquals("1st", deltaAware.getFirstComponent());
 assertEquals("2nd", deltaAware.getSecondComponent());
}

代码示例来源:origin: org.infinispan/infinispan-cachestore-leveldb

public void testEntrySetAfterExpiryWithStore() throws Exception {
 ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
 createCacheStoreConfig(cb.persistence(), true);
 cacheManager.defineConfiguration("testEntrySetAfterExpiryWithStore", cb.build());
 Cache<String, String> cache = cacheManager.getCache("testEntrySetAfterExpiryWithStore");
 cache.start();
 cache.clear();
 assertEquals(cache.entrySet().size(), 0);
 Map dataIn = new HashMap();
 dataIn.put(1, 1);
 dataIn.put(2, 2);
 cache.putAll(dataIn, EXPIRATION_TIMEOUT, TimeUnit.MILLISECONDS);
 Thread.sleep(EXPIRATION_TIMEOUT + 1000);
 assertEquals(cache.entrySet().size(), 0);
}

代码示例来源:origin: org.infinispan/infinispan-core

public void testCacheRestart() throws Exception {
 final Cache<Integer, String> cache0 = cache(0);
 final Cache<Integer, String> cache1 = cache(1);
 // Restart the cache
 cache1.stop();
 cache1.start();
 cache1.put(1, "value1");
 assertEquals("value1", cache0.get(1));
}

代码示例来源:origin: org.infinispan/infinispan-core

public void testInitialStateTransferAfterRestart(Method m) throws Exception {
 testCount++;
 logTestStart(m);
 Cache<Object, Object> cache1, cache2;
 cache1 = createCacheManager(cacheName).getCache(cacheName);
 writeInitialData(cache1);
 EmbeddedCacheManager cm2 = createCacheManager(cacheName);
 cache2 = cm2.getCache(cacheName);
 TestingUtil.waitForNoRebalance(cache1, cache2);
 verifyInitialData(cache2);
 cache2.stop();
 cache2.start();
 verifyInitialData(cache2);
 logTestEnd(m);
}

代码示例来源:origin: org.infinispan/infinispan-core

public void testPersistence() throws PersistenceException {
 cache.put("k", "v");
 assertEquals("v", cache.get("k"));
 cache.evict("k");
 assertTrue(store.contains(getInternalKey("k")));
 assertEquals("v", cache.get("k"));
 assertFalse(store.contains(getInternalKey("k")));
 cache.stop();
 cache.start();
 // The old store's marshaller is not working any more
 store = (AdvancedLoadWriteStore) TestingUtil.getCacheLoader(cache);
 assertTrue(store.contains(getInternalKey("k")));
 assertEquals("v", cache.get("k"));
 assertFalse(store.contains(getInternalKey("k")));
}

相关文章