Package org.infinispan.config

Examples of org.infinispan.config.Configuration.fluent()


   private Configuration getDefaultRecoveryCacheConfig() {
      Configuration config = new Configuration();
      //the recovery cache should not participate in main cache's transactions, especially because removals
      // from this cache are executed in the context of a finalised transaction and cause issues.
      config.fluent().transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL);
      config.fluent().clustering().mode(Configuration.CacheMode.LOCAL);
      config.fluent().expiration().lifespan(DEFAULT_EXPIRY);
      config.fluent().recovery().disable();
      return config;
   }
View Full Code Here


      Configuration config = new Configuration();
      //the recovery cache should not participate in main cache's transactions, especially because removals
      // from this cache are executed in the context of a finalised transaction and cause issues.
      config.fluent().transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL);
      config.fluent().clustering().mode(Configuration.CacheMode.LOCAL);
      config.fluent().expiration().lifespan(DEFAULT_EXPIRY);
      config.fluent().recovery().disable();
      return config;
   }

   private RecoveryManager buildRecoveryManager(String cacheName, String recoveryCacheName, EmbeddedCacheManager cm, boolean isDefault) {
View Full Code Here

      //the recovery cache should not participate in main cache's transactions, especially because removals
      // from this cache are executed in the context of a finalised transaction and cause issues.
      config.fluent().transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL);
      config.fluent().clustering().mode(Configuration.CacheMode.LOCAL);
      config.fluent().expiration().lifespan(DEFAULT_EXPIRY);
      config.fluent().recovery().disable();
      return config;
   }

   private RecoveryManager buildRecoveryManager(String cacheName, String recoveryCacheName, EmbeddedCacheManager cm, boolean isDefault) {
      log.tracef("About to obtain a reference to the recovery cache: %s", recoveryCacheName);
View Full Code Here

        boolean requiresTransport = false;
        Map<String, Configuration> configurations = config.getConfigurations();
        for (ModelNode cache : operation.require(ModelKeys.CACHE).asList()) {
            String cacheName = cache.require(ModelKeys.NAME).asString();
            Configuration configuration = new Configuration();
            FluentConfiguration fluent = configuration.fluent();
            Configuration.CacheMode mode = CacheMode.valueOf(cache.require(ModelKeys.MODE).asString());
            requiresTransport |= mode.isClustered();
            fluent.mode(mode);
            if (cache.hasDefined(ModelKeys.BATCHING)) {
                if (cache.get(ModelKeys.BATCHING).asBoolean()) {
View Full Code Here

        FluentGlobalConfiguration.GlobalJmxStatisticsConfig globalJmx = fluentTransport.globalJmxStatistics();
        globalJmx.cacheManagerName(this.configuration.getName());

        Configuration defaultConfig = new Configuration();
        FluentConfiguration fluent = defaultConfig.fluent();

        MBeanServer server = this.configuration.getMBeanServer();
        if (server != null) {
            globalJmx.mBeanServerLookup(new MBeanServerProvider(server)).jmxDomain(SERVICE_NAME.getCanonicalName());
            fluent.jmxStatistics();
View Full Code Here

   protected Configuration.CacheMode cacheMode = Configuration.CacheMode.REPL_SYNC;

   @Override
   protected void createCacheManagers() throws Exception {
      Configuration c = getDefaultClusteredConfig(cacheMode);
      c.fluent()
            .clustering().stateRetrieval().fetchInMemoryState(true);
      createClusteredCaches(1, cacheName, c);
   }

   public void testExtraChannelWithoutRpcDispatcher() throws Exception {
View Full Code Here

         cache1.put("k2", "v2");
         assert "v2".equals(cache1.get("k2"));

         // create a new cache, make sure it joins properly
         Configuration c = getDefaultClusteredConfig(cacheMode);
         c.fluent()
               .clustering().stateRetrieval().fetchInMemoryState(true);
         EmbeddedCacheManager cm = addClusterEnabledCacheManager(new TransportFlags());
         cm.defineConfiguration(cacheName, c);
         Cache cache2 = cm.getCache(cacheName);
         assert cache2.getAdvancedCache().getRpcManager().getTransport().getMembers().size() == 3;
View Full Code Here

@Test(groups = "functional", testName = "lock.L1LockTest")
public class L1LockTest extends MultipleCacheManagersTest {
   @Override
   protected void createCacheManagers() throws Throwable {
      Configuration config = getDefaultClusteredConfig(Configuration.CacheMode.DIST_SYNC, true);
      config.fluent().hash().numOwners(1).transaction().transactionManagerLookup(new DummyTransactionManagerLookup());
      createCluster(config, 2);
      waitForClusterToForm();
   }

   public void testConsistency() throws Exception {
View Full Code Here

public class ExplicitLockingAndOptimisticCachesTest extends SingleCacheManagerTest {

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      final Configuration c = getDefaultStandaloneConfig(true);
      c.fluent().transaction().lockingMode(LockingMode.OPTIMISTIC);
      return TestCacheManagerFactory.createCacheManager(c);
   }

   public void testExplicitLockingNotWorkingWithOptimisticCaches() throws Exception {
      // Also provide guarantees that the transaction will come to an end
View Full Code Here

   @Override
   protected void createCacheManagers() throws Throwable {
      Configuration cfg = TestCacheManagerFactory.getDefaultConfiguration(true, Configuration.CacheMode.DIST_SYNC);
      cfg.setLockAcquisitionTimeout(100);
      cfg.fluent().transaction().lockingMode(LockingMode.PESSIMISTIC);
      EmbeddedCacheManager cm1 = TestCacheManagerFactory.createClusteredCacheManager(cfg);
      EmbeddedCacheManager cm2 = TestCacheManagerFactory.createClusteredCacheManager(cfg);
      registerCacheManager(cm1, cm2);
      c1 = cm1.getCache();
      c2 = cm2.getCache();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.