本文整理了Java中org.infinispan.configuration.cache.Configuration.loaders()
方法的一些代码示例,展示了Configuration.loaders()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.loaders()
方法的具体详情如下:
包路径:org.infinispan.configuration.cache.Configuration
类名称:Configuration
方法名:loaders
暂无
代码示例来源:origin: org.jboss.as/jboss-as-clustering-web-infinispan
public DistributedCacheManager(LocalDistributableSessionManager manager,
Cache<String, Map<Object, Object>> cache, Registry<String, Void> registry,
SharedLocalYieldingClusterLockManager lockManager, SessionAttributeStorage<T> attributeStorage,
BatchingManager batchingManager, CacheInvoker invoker, KeyAffinityServiceFactory affinityFactory) {
this.manager = manager;
this.lockManager = lockManager;
this.cache = cache;
this.attributeStorage = attributeStorage;
this.batchingManager = batchingManager;
this.invoker = new ForceSynchronousCacheInvoker(invoker);
this.lockTimeout = this.cache.getCacheConfiguration().locking().lockAcquisitionTimeout();
Configuration configuration = this.cache.getCacheConfiguration();
this.passivationEnabled = configuration.loaders().passivation() && !configuration.loaders().shared() && !configuration.loaders().cacheLoaders().isEmpty();
this.persistenceEnabled = !configuration.loaders().passivation() && !configuration.loaders().cacheLoaders().isEmpty();
this.registry = registry;
this.affinity = affinityFactory.createService(cache, this);
}
代码示例来源:origin: org.infinispan/infinispan-cachestore-bdbje
private CacheLoaderConfiguration buildCacheManagerWithCacheStore(final String config) throws IOException {
InputStream is = new ByteArrayInputStream(config.getBytes());
cacheManager = TestCacheManagerFactory.fromStream(is);
assert cacheManager.getDefaultCacheConfiguration().loaders().cacheLoaders().size() == 1;
return cacheManager.getDefaultCacheConfiguration().loaders().cacheLoaders().get(0);
}
}
代码示例来源:origin: org.infinispan/infinispan-cachestore-bdbje
public void testBdbjeCacheStoreConfigurationAdaptor() {
ConfigurationBuilder b = new ConfigurationBuilder();
b.loaders().addStore(BdbjeCacheStoreConfigurationBuilder.class).location("/tmp/bdbje").cacheDbNamePrefix("myprefix").catalogDbName("mycatalog").fetchPersistentState(true).async().enable();
Configuration configuration = b.build();
BdbjeCacheStoreConfiguration store = (BdbjeCacheStoreConfiguration) configuration.loaders().cacheLoaders().get(0);
assert store.location().equals("/tmp/bdbje");
assert store.cacheDbNamePrefix().equals("myprefix");
assert store.catalogDbName().equals("mycatalog");
assert store.fetchPersistentState();
assert store.async().enabled();
b = new ConfigurationBuilder();
b.loaders().addStore(BdbjeCacheStoreConfigurationBuilder.class).read(store);
Configuration configuration2 = b.build();
BdbjeCacheStoreConfiguration store2 = (BdbjeCacheStoreConfiguration) configuration2.loaders().cacheLoaders().get(0);
assert store2.location().equals("/tmp/bdbje");
assert store2.cacheDbNamePrefix().equals("myprefix");
assert store2.catalogDbName().equals("mycatalog");
assert store2.fetchPersistentState();
assert store2.async().enabled();
BdbjeCacheStoreConfig legacy = store.adapt();
assert legacy.getLocation().equals("/tmp/bdbje");
assert legacy.getCacheDbNamePrefix().equals("myprefix");
assert legacy.getCatalogDbName().equals("mycatalog");
assert legacy.isFetchPersistentState();
assert legacy.getAsyncStoreConfig().isEnabled();
}
}
内容来源于网络,如有侵权,请联系作者删除!