Package org.infinispan.transaction.lookup

Examples of org.infinispan.transaction.lookup.GenericTransactionManagerLookup


                .build(); //Builds  the GlobalConfiguration object
            Configuration loc = new ConfigurationBuilder()
                .jmxStatistics().enable() //Enable JMX statistics
                .clustering().cacheMode(CacheMode.LOCAL) //Set Cache mode to LOCAL - Data is not replicated.
                .transaction().transactionMode(TransactionMode.TRANSACTIONAL).autoCommit(false) //Enable Transactional mode with autocommit false
                .lockingMode(LockingMode.OPTIMISTIC).transactionManagerLookup(new GenericTransactionManagerLookup()) //uses GenericTransactionManagerLookup - This is a lookup class that locate transaction managers in the most  popular Java EE application servers. If no transaction manager can be found, it defaults on the dummy transaction manager.
                .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) //Sets the isolation level of locking
                .eviction().maxEntries(100).strategy(EvictionStrategy.LIRS) //Sets  4 as maximum number of entries in a cache instance and uses the LIRS strategy - an efficient low inter-reference recency set replacement policy to improve buffer cache performance
                .loaders().passivation(false).addFileCacheStore().purgeOnStartup(true) //Disable passivation and adds a FileCacheStore that is purged on Startup
                .build(); //Builds the Configuration object
            manager = new DefaultCacheManager(glob, loc, true);
View Full Code Here


                .build(); //Builds  the GlobalConfiguration object
            Configuration loc = new ConfigurationBuilder()
                .jmxStatistics().enable() //Enable JMX statistics
                .clustering().cacheMode(CacheMode.LOCAL) //Set Cache mode to LOCAL - Data is not replicated.
                .transaction().transactionMode(TransactionMode.TRANSACTIONAL).autoCommit(false) //Enable Transactional mode with autocommit false
                .lockingMode(LockingMode.OPTIMISTIC).transactionManagerLookup(new GenericTransactionManagerLookup()) //uses GenericTransactionManagerLookup - This is a lookup class that locate transaction managers in the most  popular Java EE application servers. If no transaction manager can be found, it defaults on the dummy transaction manager.
                .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) //Sets the isolation level of locking
                .eviction().maxEntries(4).strategy(EvictionStrategy.LIRS) //Sets  4 as maximum number of entries in a cache instance and uses the LIRS strategy - an efficient low inter-reference recency set replacement policy to improve buffer cache performance
                .persistence().passivation(false).addSingleFileStore().purgeOnStartup(true) //Disable passivation and adds a FileCacheStore that is purged on Startup
                .build(); //Builds the Configuration object
            manager = new DefaultCacheManager(glob, loc, true);
View Full Code Here

      EmbeddedCacheManager cm = createLocalCacheManager(false);

      org.infinispan.config.Configuration c = new org.infinispan.config.Configuration();
      c.setL1CacheEnabled(false);
      c.setL1OnRehash(false);
      c.setTransactionManagerLookup(new GenericTransactionManagerLookup());
      c.setIsolationLevel(IsolationLevel.NONE);
      org.infinispan.config.Configuration oneCacheConfiguration = cm.defineConfiguration("oneCache", c);
      assert oneCacheConfiguration.equalsIgnoreName(c);
      assert oneCacheConfiguration.getIsolationLevel().equals(IsolationLevel.NONE);
View Full Code Here

        Configuration local = new ConfigurationBuilder()
            .clustering()
                .cacheMode(CacheMode.LOCAL)
            .transaction()
                .transactionMode(TransactionMode.TRANSACTIONAL)
                .transactionManagerLookup(new GenericTransactionManagerLookup())
             .autoCommit(false)
            .build();
        return new DefaultCacheManager(global, local);
    }
View Full Code Here

   @Override
   void validate() {
      if (transactionManagerLookup == null) {
         if (!getBuilder().invocationBatching().enabled) {
            transactionManagerLookup = new GenericTransactionManagerLookup();
         } else {
            if (!useSynchronization) log.debug("Switching to Synchronization based enlistment.");
            useSynchronization = true;
         }
      }
View Full Code Here

      EmbeddedCacheManager cm = createLocalCacheManager(false);

      org.infinispan.config.Configuration c = new org.infinispan.config.Configuration();
      c.setL1CacheEnabled(false);
      c.setL1OnRehash(false);
      c.setTransactionManagerLookup(new GenericTransactionManagerLookup());
      c.setIsolationLevel(IsolationLevel.NONE);
      org.infinispan.config.Configuration oneCacheConfiguration = cm.defineConfiguration("oneCache", c);
      assert oneCacheConfiguration.equalsIgnoreName(c);
      assert oneCacheConfiguration.getIsolationLevel().equals(IsolationLevel.NONE);
View Full Code Here

   @Override
   void validate() {
      if (transactionManagerLookup == null) {
         if (!getBuilder().invocationBatching().enabled) {
            transactionManagerLookup = new GenericTransactionManagerLookup();
         } else {
            if (!useSynchronization) log.debug("Switching to Synchronization based enlistment.");
            useSynchronization = true;
         }
      }
View Full Code Here

   @Override
   void validate() {
      if (transactionManagerLookup == null) {
         if (!getBuilder().invocationBatching().enabled) {
            transactionManagerLookup = new GenericTransactionManagerLookup();
         } else {
            if (!useSynchronization) log.debug("Switching to Synchronization based enlistment.");
            useSynchronization = true;
         }
      }
View Full Code Here

   @Override
   void validate() {
      if (transactionManagerLookup == null) {
         if (!getBuilder().invocationBatching().enabled) {
            transactionManagerLookup = new GenericTransactionManagerLookup();
         } else {
            if (!useSynchronization) log.debug("Switching to Synchronization based enlistment.");
            useSynchronization = true;
         }
      }
View Full Code Here

public class TransactionManagerLookupTest extends AbstractInfinispanTest {
  
   Configuration configuration = new ConfigurationBuilder().build();

   public void testGenericTransactionManagerLookup() throws Exception {
      GenericTransactionManagerLookup lookup = new GenericTransactionManagerLookup();
      lookup.setConfiguration(configuration);
      doTest(lookup);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.transaction.lookup.GenericTransactionManagerLookup

Copyright © 2018 www.massapicom. 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.