Package org.infinispan.transaction.lookup

Examples of org.infinispan.transaction.lookup.TransactionManagerLookup


            Configuration configFromXml = cacheManager.getDefaultCacheConfiguration();
            ConfigurationBuilder configBuilder = new ConfigurationBuilder().read(configFromXml);

            // Configure transactionManagerLookup programmatically if not provided in configuration
            TransactionManagerLookup tmLookup = configFromXml.transaction().transactionManagerLookup();
            if (tmLookup == null) {
                tmLookup = getTransactionManagerLookup();
                configBuilder.transaction().transactionManagerLookup(tmLookup);
            }
            log.debug("Infinispan transaction manager lookup: " + tmLookup);
View Full Code Here


@DefaultFactoryFor(classes = {TransactionManager.class})
public class TransactionManagerFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory {
   public <T> T construct(Class<T> componentType) {
      // See if we had a TransactionManager injected into our config
      TransactionManager transactionManager = null;
      TransactionManagerLookup lookup = configuration.getTransactionManagerLookup();

      if (lookup == null) {
         // Nope. See if we can look it up from JNDI
         if (configuration.getTransactionManagerLookupClass() != null) {
            lookup = (TransactionManagerLookup) Util.getInstance(configuration.getTransactionManagerLookupClass(), configuration.getClassLoader());
         }
      }

      try {
         if (lookup != null) {
            componentRegistry.wireDependencies(lookup);
            transactionManager = lookup.getTransactionManager();
         }
      }
      catch (Exception e) {
         log.info("failed looking up TransactionManager, will not use transactions", e);
      }
View Full Code Here

         .transactionSynchronizationRegistryLookup(legacy.getTransactionSynchronizationRegistryLookup())
         .useEagerLocking(legacy.isUseEagerLocking())
         .useSynchronization(legacy.isUseSynchronizationForTransactions())
         .use1PcForAutoCommitTransactions(legacy.isUse1PcForAutoCommitTransactions());

      TransactionManagerLookup tmLookup = legacy.getTransactionManagerLookup();
      if (tmLookup != null) {
         builder.transaction().transactionManagerLookup(tmLookup);
      } else {
         String tmLookupClass = legacy.getTransactionManagerLookupClass();
         if (tmLookupClass != null) {
View Full Code Here

@DefaultFactoryFor(classes = {TransactionManager.class})
public class TransactionManagerFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory {
   public <T> T construct(Class<T> componentType) {
      // See if we had a TransactionManager injected into our config
      TransactionManager transactionManager = null;
      TransactionManagerLookup lookup = configuration.getTransactionManagerLookup();

      if (lookup == null) {
         // Nope. See if we can look it up from JNDI
         if (configuration.getTransactionManagerLookupClass() != null) {
            lookup = (TransactionManagerLookup) Util.getInstance(configuration.getTransactionManagerLookupClass());
         }
      }

      try {
         if (lookup != null) {
            transactionManager = lookup.getTransactionManager();
         }
      }
      catch (Exception e) {
         log.info("failed looking up TransactionManager, will not use transactions", e);
      }
View Full Code Here

@DefaultFactoryFor(classes = {TransactionManager.class})
public class TransactionManagerFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory {
   public <T> T construct(Class<T> componentType) {
      // See if we had a TransactionManager injected into our config
      TransactionManager transactionManager = null;
      TransactionManagerLookup lookup = configuration.getTransactionManagerLookup();

      if (lookup == null) {
         // Nope. See if we can look it up from JNDI
         if (configuration.getTransactionManagerLookupClass() != null) {
            lookup = (TransactionManagerLookup) Util.getInstance(configuration.getTransactionManagerLookupClass());
         }
      }

      try {
         if (lookup != null) {
            transactionManager = lookup.getTransactionManager();
         }
      }
      catch (Exception e) {
         log.info("failed looking up TransactionManager, will not use transactions", e);
      }
View Full Code Here

@DefaultFactoryFor(classes = {TransactionManager.class})
public class TransactionManagerFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory {
   public <T> T construct(Class<T> componentType) {
      // See if we had a TransactionManager injected into our config
      TransactionManager transactionManager = null;
      TransactionManagerLookup lookup = configuration.getTransactionManagerLookup();

      if (lookup == null) {
         // Nope. See if we can look it up from JNDI
         if (configuration.getTransactionManagerLookupClass() != null) {
            try {
               lookup = (TransactionManagerLookup) Util.getInstance(configuration.getTransactionManagerLookupClass());
            }
            catch (Exception e) {
               throw new ConfigurationException("Problems looking up transaction manager", e);
            }
         }
      }
     
      try {
         if (lookup != null) {
            transactionManager = lookup.getTransactionManager();
         }
      }
      catch (Exception e) {
         log.info("failed looking up TransactionManager, will not use transactions", e);
      }
View Full Code Here

         .transactionSynchronizationRegistryLookup(legacy.getTransactionSynchronizationRegistryLookup())
         .useEagerLocking(legacy.isUseEagerLocking())
         .useSynchronization(legacy.isUseSynchronizationForTransactions())
         .use1PcForAutoCommitTransactions(legacy.isUse1PcForAutoCommitTransactions());

      TransactionManagerLookup tmLookup = legacy.getTransactionManagerLookup();
      if (tmLookup != null) {
         builder.transaction().transactionManagerLookup(tmLookup);
      } else {
         String tmLookupClass = legacy.getTransactionManagerLookupClass();
         if (tmLookupClass != null) {
View Full Code Here

         log.usingBatchModeTransactionManager();
         transactionManager = BatchModeTransactionManager.getInstance();
      }

      if (transactionManager == null) {
         TransactionManagerLookup lookup = configuration.transaction().transactionManagerLookup();
         try {
            if (lookup != null) {
               componentRegistry.wireDependencies(lookup);
               transactionManager = lookup.getTransactionManager();
            }
         }
         catch (Exception e) {
            log.couldNotInstantiateTransactionManager(e);
         }
View Full Code Here

         }
      }
      ConfigurationBuilder confBuilder = holder.getDefaultConfigurationBuilder();
      if (tm != null)
      {
         TransactionManagerLookup tml = new TransactionManagerLookup()
         {
            public TransactionManager getTransactionManager() throws Exception
            {
               return tm;
            }
View Full Code Here

         return null;
      }

      // See if we had a TransactionManager injected into our config
      TransactionManager transactionManager = null;
      TransactionManagerLookup lookup = configuration.getTransactionManagerLookup();

      if (lookup == null) {
         // Nope. See if we can look it up from JNDI
         if (configuration.getTransactionManagerLookupClass() != null) {
            lookup = (TransactionManagerLookup) Util.getInstance(configuration.getTransactionManagerLookupClass(), configuration.getClassLoader());
         }
      }

      try {
         if (lookup != null) {
            componentRegistry.wireDependencies(lookup);
            transactionManager = lookup.getTransactionManager();
         }
      }
      catch (Exception e) {
         log.couldNotInstantiateTransactionManager(e);
      }
View Full Code Here

TOP

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

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.