Package org.infinispan.transaction.lookup

Examples of org.infinispan.transaction.lookup.TransactionManagerLookup


      }

      // See if we had a TransactionManager injected into our config
      TransactionManager 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


@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; //configuration.getRuntimeConfig().getTransactionManager();
      TransactionManagerLookup lookup = null;

      if (transactionManager == null) {
         // Nope. See if we can look it up from JNDI
         if (configuration.getTransactionManagerLookupClass() != null) {
            try {
               ClassLoader cl = Thread.currentThread().getContextClassLoader();
               if (cl == null) cl = getClass().getClassLoader();
               Class clazz = cl.loadClass(configuration.getTransactionManagerLookupClass());
               lookup = (TransactionManagerLookup) clazz.newInstance();
            }
            catch (Exception e) {
               throw new ConfigurationException("Problems looking up transaction manager", e);
            }
         }

         try {
            if (lookup != null) {
               transactionManager = lookup.getTransactionManager();
//               configuration.getRuntimeConfig().setTransactionManager(transactionManager);
            }
         }
         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

         }
      }
      ConfigurationBuilder confBuilder = holder.getDefaultConfigurationBuilder();
      if (tm != null)
      {
         TransactionManagerLookup tml = new TransactionManagerLookup()
         {
            public TransactionManager getTransactionManager() throws Exception
            {
               return tm;
            }
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

         .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

         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

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

               GlobalConfigurationBuilder configBuilder = holder.getGlobalConfigurationBuilder();
               Utils.loadJGroupsConfig(configManager, configBuilder.build(), configBuilder);
               // Create the CacheManager from the new configuration
               EmbeddedCacheManager manager =
                  new DefaultCacheManager(configBuilder.build(), holder.getDefaultConfigurationBuilder().build());
               TransactionManagerLookup tml = new TransactionManagerLookup()
               {
                  public TransactionManager getTransactionManager() throws Exception
                  {
                     return tm;
                  }
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

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.