Package org.infinispan.config

Examples of org.infinispan.config.Configuration$VersioningConfigurationBean


      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


      markAsOverriden("isExposeStatistics");
      this.isExposeStatistics = isExposeStatistics;
   }

   public Configuration createInfinispanConfiguration() {
      Configuration cacheCfg = new Configuration();
      if (overridden.contains("evictionStrategy")) cacheCfg.setEvictionStrategy(evictionStrategy);
      if (overridden.contains("evictionWakeUpInterval")) cacheCfg.setEvictionWakeUpInterval(evictionWakeUpInterval);
      if (overridden.contains("evictionMaxEntries")) cacheCfg.setEvictionMaxEntries(evictionMaxEntries);
      if (overridden.contains("expirationLifespan")) cacheCfg.setExpirationLifespan(expirationLifespan);
      if (overridden.contains("expirationMaxIdle")) cacheCfg.setExpirationMaxIdle(expirationMaxIdle);
      if (overridden.contains("isExposeStatistics")) cacheCfg.setExposeJmxStatistics(isExposeStatistics);
      return cacheCfg;
   }
View Full Code Here

            if (log.isInfoEnabled()) log.namedCacheDoesNotExist(cacheName);
            return new ExceptionResponse(new NamedCacheNotFoundException(cacheName, "Cannot process command " + cmd + " on node " + transport.getAddress()));
         }
      }

      final Configuration localConfig = cr.getComponent(Configuration.class);
      cmd.injectComponents(localConfig, cr);
      return handleWithRetry(cmd);
   }
View Full Code Here

      return resp;
   }

   public JoinHandle howToHandle(CacheRpcCommand cmd) {
      Configuration localConfig = cmd.getConfiguration();
      ComponentRegistry cr = cmd.getComponentRegistry();

      if (localConfig.getCacheMode().isDistributed()) {
         DistributionManager dm = cr.getComponent(DistributionManager.class);
         if (dm.isJoinComplete())
            return JoinHandle.OK;
         else {
            // no point in enqueueing clustered GET commands - just ignore these and hope someone else in the cluster responds.
            if (!(cmd instanceof ClusteredGetCommand))
               return JoinHandle.QUEUE;
            else
               return JoinHandle.IGNORE;
         }
      } else {
         long giveupTime = System.currentTimeMillis() + localConfig.getStateRetrievalTimeout();
         while (cr.getStatus().startingUp() && System.currentTimeMillis() < giveupTime)
            LockSupport.parkNanos(MILLISECONDS.toNanos(100));
         if (!cr.getStatus().allowInvocations()) {
            log.cacheCanNotHandleInvocations(cmd.getCacheName(), cr.getStatus());
            return JoinHandle.IGNORE;
View Full Code Here

      // Handle the case that null is passed in
      if (config == null)
         return null;

      FluentConfiguration legacy = new Configuration().fluent();

      legacy.clustering()
         .mode(CacheMode.valueOf(config.clustering().cacheMode().name()));

      if (!config.clustering().cacheMode().isSynchronous()) {
View Full Code Here

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

               new ConfigurationValidatingVisitor());

         globalConfiguration = configuration.parseGlobalConfiguration();
         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);
      } catch (RuntimeException re) {
         throw new ConfigurationException(re);
View Full Code Here

               configurationStream, InfinispanConfiguration.findSchemaInputStream(),
               new ConfigurationValidatingVisitor());
         globalConfiguration = configuration.parseGlobalConfiguration();
         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);
      } catch (ConfigurationException ce) {
         throw ce;
View Full Code Here

            InfinispanConfiguration NCconfiguration = InfinispanConfiguration.newInfinispanConfiguration(
                  namedCacheFile, InfinispanConfiguration.resolveSchemaPath(),
                  new ConfigurationValidatingVisitor());

            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);
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public Configuration defineConfiguration(String cacheName, String templateName, Configuration configurationOverride) {
      if (templateName != null) {
         Configuration c = configurationOverrides.get(templateName);
         if (c != null)
            return defineConfiguration(cacheName, configurationOverride, c, false);
         return defineConfiguration(cacheName, configurationOverride);
      }
      return defineConfiguration(cacheName, configurationOverride);
View Full Code Here

TOP

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

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.