Package org.infinispan.transaction.lookup

Examples of org.infinispan.transaction.lookup.TransactionManagerLookup


         }
      }
      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(), Thread.currentThread().getContextClassLoader());
         }
      }

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

      if (transactionManager == 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();
//               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

                  configuration.transaction().transactionManagerLookup());
   }

   public final void configurationOverridesShouldOverrideTransactionManagerLookupPropIfExplicitlySet()
         throws Exception {
      final TransactionManagerLookup expectedTransactionManagerLookup = new JBossTransactionManagerLookup();

      final ConfigurationOverrides objectUnderTest = new ConfigurationOverrides();
      objectUnderTest.setTransactionManagerLookup(expectedTransactionManagerLookup);
      final ConfigurationBuilder defaultConfiguration = new ConfigurationBuilder();
      objectUnderTest.applyOverridesTo(defaultConfiguration);
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

      }

      // 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

   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().transactionManagerLookup(new TransactionManagerLookup() {
         @Override
         public TransactionManager getTransactionManager() throws Exception {
            return 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(), 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

               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

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.