Package org.infinispan.config

Examples of org.infinispan.config.Configuration$TransactionType


        "    </InWaterA_1M> " +
        "   </wfs:Insert> " +
        "</wfs:Transaction> ";
        buildDocument(xml);
       
        TransactionType t = (TransactionType) parse();
        assertNotNull(t);
       
        assertEquals(1, t.getAbstractTransactionAction().size());
        assertEquals(1, t.getGroup().size());
       
        InsertType i = (InsertType) t.getAbstractTransactionAction().get(0);
        assertEquals(2, i.getAny().size());
    }
View Full Code Here


        "      </fes:Filter> " +
        "   </wfs:Update> " +
        "</wfs:Transaction> ";
        buildDocument(xml);
       
        TransactionType t = (TransactionType) parse();
        assertNotNull(t);
       
        assertEquals(1, t.getAbstractTransactionAction().size());
       
        UpdateType u = (UpdateType) t.getAbstractTransactionAction().get(0);
        assertEquals(1, u.getProperty().size());
       
        PropertyType p = u.getProperty().get(0);
        assertEquals("population", p.getValueReference().getValue().getLocalPart());
        assertEquals("4070000", p.getValue());
View Full Code Here

        "      </fes:Filter> " +
        "   </wfs:Delete> " +
        "</wfs:Transaction> ";
        buildDocument(xml);
       
        TransactionType t = (TransactionType) parse();
        assertEquals(1, t.getAbstractTransactionAction().size());
       
        DeleteType d = (DeleteType) t.getAbstractTransactionAction().get(0);
        assertNotNull(d.getFilter());
       
        Id id = (Id) d.getFilter();
        assertTrue(id.getIDs().contains("InWaterA_1M.1013"));
View Full Code Here

      CacheCategory category = entry.getKey();
      InfinispanConfiguration config = entry.getValue();
      if (config.isCacheEnabled()) {
        String configurationName = config.getConfigurationName();
        if (null == configurationName) {
          Configuration infinispan;
          infinispan = manager.getDefaultConfiguration().clone();
          infinispan.applyOverrides(config.getInfinispanConfiguration());
          configurationName = "$" + category.getName() + "$" + cacheInfo.getId();
          manager.defineConfiguration(configurationName, infinispan);
        }
        recorder.record("infinispan", "configuration name " + configurationName);
        cacheService = new InfinispanCacheService(manager.<String, Object>getCache(configurationName));
View Full Code Here

  
   @Override
   public boolean isDistributed()
   {
      EmbeddedCacheManager container = (EmbeddedCacheManager) this.container;
      Configuration config = (this.cacheName != null) ? container.defineConfiguration(this.cacheName, new Configuration()) : container.getDefaultConfiguration();
      return config.getCacheMode().isDistributed();
   }
View Full Code Here

      GlobalConfiguration global = local ? GlobalConfiguration.getNonClusteredDefault() : GlobalConfiguration.getClusteredDefault();
      global.setClusterName("testing");
      global.setCacheManagerName("container" + containerIndex++);
      global.setStrictPeerToPeer(false);

      Configuration config = new Configuration();
      config.setInvocationBatchingEnabled(true);
      config.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      config.setSyncReplTimeout(20000);
      config.setLockAcquisitionTimeout(15000);
      config.setCacheMode(local ? CacheMode.LOCAL : (totalReplication ? CacheMode.REPL_SYNC : CacheMode.DIST_SYNC));
     
      CacheMode mode = config.getCacheMode();

      config.setFetchInMemoryState(mode.isReplicated());
     
      // Block for commits -- no races between test driver and replication
      config.setSyncCommitPhase(true);
      config.setSyncRollbackPhase(true);
     
      if (passivationDir != null)
      {
         CacheLoaderManagerConfig managerConfig = new CacheLoaderManagerConfig();
         managerConfig.setPassivation(true);
         managerConfig.setPreload(!purgeCacheLoader);
        
         FileCacheStoreConfig fileConfig = new FileCacheStoreConfig();
         fileConfig.setLocation(passivationDir);
         fileConfig.setFetchPersistentState(mode.isReplicated());
         fileConfig.setPurgeOnStartup(purgeCacheLoader);
        
         managerConfig.setCacheLoaderConfigs(Collections.<CacheLoaderConfig>singletonList(fileConfig));
        
         config.setCacheLoaderManagerConfig(managerConfig);
      }
     
      final EmbeddedCacheManager sessionContainer = new DefaultCacheManager(global, config, false);
     
      global = local ? GlobalConfiguration.getNonClusteredDefault() : GlobalConfiguration.getClusteredDefault();
      global.setClusterName("testing-jvmroute");
      global.setCacheManagerName("container" + containerIndex++);
      global.setStrictPeerToPeer(false);
     
      config = new Configuration();
      config.setInvocationBatchingEnabled(true);
      config.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      config.setSyncReplTimeout(20000);
      config.setLockAcquisitionTimeout(15000);
      config.setCacheMode(CacheMode.REPL_SYNC);
      config.setFetchInMemoryState(true);
      config.setSyncCommitPhase(true);
      config.setSyncRollbackPhase(true);
     
      final EmbeddedCacheManager jvmRouteContainer = new DefaultCacheManager(global, config, false);
     
      return new EmbeddedCacheManager()
      {
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 AdvancedCache 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 cache;
   }

   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());
      if (templateConfig.isTransactionalCache()) {
         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

      assertInitialized();
      if (gc == null) {
         Element defaultElement = getSingleElementInCoreNS("default", rootElement);
         // there may not be a <default /> element!
         if (defaultElement == null) {
            return new Configuration();
         } else {
            defaultElement.normalize();
            return parseConfiguration(defaultElement);
         }
      } else {
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.