Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ISPN-2267 Migrate deprecated configuration API in infinispan-query, i…

…nfinispan-rhq
  • Loading branch information...
commit 30c054b3df80508d47e602848d6878aeb42c7b93 1 parent 2cf2317
@kosch kosch authored Mircea Markus committed
View
2  ...tension/src/test/java/org/infinispan/cdi/test/interceptor/CacheResultInterceptorTest.java
@@ -179,6 +179,6 @@ public void testCacheResultWithSpecificCacheManager() {
assertEquals(service.getNbCall(), 1);
assertEquals(smallCache.size(), 1);
- assertEquals(smallCache.getConfiguration().getEvictionMaxEntries(), 4);
+ assertEquals(smallCache.getCacheConfiguration().eviction().maxEntries(), 4);
}
}
View
2  demos/nearcache-client/src/main/java/org/infinispan/nearcache/cdi/Config.java
@@ -41,7 +41,7 @@
public Configuration addressCache() {
return new ConfigurationBuilder()
.eviction().strategy(EvictionStrategy.LRU).maxEntries(4)
- .loaders().shared(true).addCacheLoader().cacheLoader(new RemoteEventCacheStore())
+ .loaders().shared(true).addStore().cacheStore(new RemoteEventCacheStore())
.build();
}
View
6 query/src/test/java/org/infinispan/query/cacheloaders/EntryActivatingTest.java
@@ -111,9 +111,9 @@ private void recreateCacheManager() {
cfg.loaders()
.preload(true)
.passivation(true)
- .addCacheLoader()
- .cacheLoader( new DummyInMemoryCacheStore() )
- .purgeOnStartup(true)
+ .addStore()
+ .cacheStore(new DummyInMemoryCacheStore())
+ .purgeOnStartup(true)
.indexing()
.enable()
.addProperty("hibernate.search.default.directory_provider", "ram")
View
24 rhq-plugin/src/test/java/org/infinispan/rhq/InfinispanRhqTest.java
@@ -23,8 +23,8 @@
package org.infinispan.rhq;
import org.infinispan.Cache;
-import org.infinispan.config.Configuration;
-import org.infinispan.config.GlobalConfiguration;
+import org.infinispan.configuration.cache.ConfigurationBuilder;
+import org.infinispan.configuration.global.GlobalConfigurationBuilder;
import org.infinispan.test.CacheManagerCallable;
import org.infinispan.test.fwk.TestCacheManagerFactory;
@@ -40,23 +40,23 @@
private static final String MY_CUSTOM_CACHE = "myCustomCache";
public static void main(String[] args) throws Exception {
- GlobalConfiguration myGlobalConfig = new GlobalConfiguration();
- // org.infinispan:cache-name=[global],jmx-resource=CacheManager
- myGlobalConfig.setJmxDomain("org.infinispan");
- myGlobalConfig.setExposeGlobalJmxStatistics(true);
- withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.createCacheManager(myGlobalConfig)) {
+ GlobalConfigurationBuilder globalConfigurationBuilder = new GlobalConfigurationBuilder();
+ globalConfigurationBuilder.globalJmxStatistics().enable().jmxDomain("org.infinispan");
+
+ withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.createCacheManager(globalConfigurationBuilder, new ConfigurationBuilder())) {
@Override
public void call() {
// org.infinispan:cache-name=myCustomcache(local),jmx-resource=CacheMgmgtInterceptor
// org.infinispan:cache-name=myCustomcache(local),jmx-resource=MvccLockManager
// org.infinispan:cache-name=myCustomcache(local),jmx-resource=TxInterceptor
- Configuration config = new Configuration();
- config.setExposeJmxStatistics(true);
- config.setEvictionMaxEntries(123);
- config.setExpirationMaxIdle(180000);
+ ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
+ configurationBuilder.jmxStatistics().enable();
+ configurationBuilder.eviction().maxEntries(123);
+ configurationBuilder.expiration().maxIdle(180000);
+
+ cm.defineConfiguration(MY_CUSTOM_CACHE, configurationBuilder.build());
- cm.defineConfiguration(MY_CUSTOM_CACHE, config);
Cache<String,String> cache = cm.getCache(MY_CUSTOM_CACHE);
cache.put("myKey", "myValue");
Please sign in to comment.
Something went wrong with that request. Please try again.