Package org.infinispan.config

Examples of org.infinispan.config.Configuration$TransactionType


      globalConfiguration.setExposeGlobalJmxStatistics(true);
      globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());
      globalConfiguration.setJmxDomain(JMX_DOMAIN);
      cacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(globalConfiguration);

      Configuration configuration = getDefaultClusteredConfig(Configuration.CacheMode.LOCAL);
      configuration.setExposeJmxStatistics(true);
      cacheManager.defineConfiguration("test", configuration);
      cache = cacheManager.getCache("test");
      advanced = cache.getAdvancedCache();
      mgmtInterceptor = getCacheObjectName(JMX_DOMAIN, "test(local)", "Statistics");
View Full Code Here


@Test(groups = "functional", testName = "atomic.AtomicMapReplTest")
public class AtomicMapReplTest extends MultipleCacheManagersTest {

   protected void createCacheManagers() throws Throwable {
      Configuration c = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC, true);
      c.setInvocationBatchingEnabled(true);
      createClusteredCaches(2, "atomic", c);
   }
View Full Code Here

   TransactionManager tm;
   private CacheContainer cacheContainer;

   @BeforeTest
   public void setUp() {
      Configuration c = new Configuration();
      c.setInvocationBatchingEnabled(true);
      cacheContainer = TestCacheManagerFactory.createCacheManager(c);
      cache = cacheContainer.getCache();
      tm = TestingUtil.getTransactionManager(cache);
   }
View Full Code Here

   private void defineGenericDataTypeCacheConfigurations(Settings settings, Properties properties) throws CacheException {
      String[] defaultGenericDataTypes = new String[]{ENTITY_KEY, COLLECTION_KEY, TIMESTAMPS_KEY, QUERY_KEY};
      for (String type : defaultGenericDataTypes) {
         TypeOverrides override = overrideStatisticsIfPresent(typeOverrides.get(type), properties);
         String cacheName = override.getCacheName();
         Configuration newCacheCfg = override.createInfinispanConfiguration();
         // Apply overrides
         Configuration cacheConfig = manager.defineConfiguration(cacheName, cacheName, newCacheCfg);
         // Configure transaction manager
         cacheConfig = configureTransactionManager(cacheConfig, cacheName, properties);
         manager.defineConfiguration(cacheName, cacheName, cacheConfig);
         definedConfigurations.add(cacheName);
         override.validateInfinispanConfiguration(cacheConfig);
View Full Code Here

   private Cache getCache(String regionName, String typeKey, Properties properties) {
      TypeOverrides regionOverride = typeOverrides.get(regionName);
      if (!definedConfigurations.contains(regionName)) {
         String templateCacheName = null;
         Configuration regionCacheCfg = null;
         if (regionOverride != null) {
            if (log.isDebugEnabled()) log.debug("Cache region specific configuration exists: " + regionOverride);
            regionOverride = overrideStatisticsIfPresent(regionOverride, properties);
            regionCacheCfg = regionOverride.createInfinispanConfiguration();
            String cacheName = regionOverride.getCacheName();
View Full Code Here

      return manager.getCache(regionName);
   }

   private Configuration configureTransactionManager(Configuration regionOverrides, String templateCacheName, Properties properties) {
      // Get existing configuration to verify whether a tm was configured or not.
      Configuration templateConfig = manager.defineConfiguration(templateCacheName, new Configuration());
      String ispnTmLookupClassName = templateConfig.getTransactionManagerLookupClass();
      String hbTmLookupClassName = org.hibernate.cache.infinispan.tm.HibernateTransactionManagerLookup.class.getName();
      if (ispnTmLookupClassName != null && !ispnTmLookupClassName.equals(hbTmLookupClassName)) {
         log.debug("Infinispan is configured [" + ispnTmLookupClassName + "] with a different transaction manager lookup " +
               "class than Hibernate [" + hbTmLookupClassName + "]");
      } else {
View Full Code Here

   public DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration,
                              boolean start) {
      this.globalConfiguration = globalConfiguration == null ? new GlobalConfiguration() : globalConfiguration
              .clone();
      this.globalConfiguration.accept(configurationValidator);
      this.defaultConfiguration = defaultConfiguration == null ? new Configuration() : defaultConfiguration.clone();
      this.globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, reflectionCache, caches.keySet());
      this.cacheCreateLock = new ReentrantLock();
      if (start)
         start();
   }
View Full Code Here

         globalConfiguration = configuration.parseGlobalConfiguration();
         globalConfiguration.accept(configurationValidator);
         defaultConfiguration = configuration.parseDefaultConfiguration();
         for (Map.Entry<String, Configuration> entry : configuration.parseNamedConfigurations().entrySet()) {
            Configuration c = defaultConfiguration.clone();
            c.applyOverrides(entry.getValue());
            configurationOverrides.put(entry.getKey(), c);
         }
         globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this, reflectionCache, caches.keySet());
         cacheCreateLock = new ReentrantLock();
      } catch (RuntimeException re) {
View Full Code Here

                 configurationStream, schemaInputStream);
         globalConfiguration = configuration.parseGlobalConfiguration();
         globalConfiguration.accept(configurationValidator);
         defaultConfiguration = configuration.parseDefaultConfiguration();
         for (Map.Entry<String, Configuration> entry : configuration.parseNamedConfigurations().entrySet()) {
            Configuration c = defaultConfiguration.clone();
            c.applyOverrides(entry.getValue());
            configurationOverrides.put(entry.getKey(), c);
         }
         globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this, reflectionCache, caches.keySet());
         cacheCreateLock = new ReentrantLock();
      } catch (ConfigurationException ce) {
View Full Code Here

            InfinispanConfiguration NCconfiguration = InfinispanConfiguration.newInfinispanConfiguration(
                    namedCacheFile, InfinispanConfiguration.resolveSchemaPath(),
                    Thread.currentThread().getContextClassLoader());

            for (Map.Entry<String, Configuration> entry : NCconfiguration.parseNamedConfigurations().entrySet()) {
               Configuration c = defaultConfiguration.clone();
               c.applyOverrides(entry.getValue());
               configurationOverrides.put(entry.getKey(), c);
            }
         }

         globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, reflectionCache, caches.keySet());
View Full Code Here

TOP

Related Classes of org.infinispan.config.Configuration$TransactionType

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.