Package org.infinispan.config

Examples of org.infinispan.config.GlobalConfiguration$SerializationConfig


            }
            configuration.fluent().mode(mode);
            defaults.add(mode, configuration);
        }
*/
        GlobalConfiguration global = new GlobalConfiguration(this.getClass().getClassLoader());
        global.fluent()
            .transport().distributedSyncTimeout(60000L)
            .shutdown().hookBehavior(ShutdownHookBehavior.DONT_REGISTER)
            ;
        Defaults defaults = new Defaults(global);
        Configuration defaultConfig = new Configuration();
View Full Code Here


     */
    @Override
    public void start(StartContext context) throws StartException {

        EmbeddedCacheManagerDefaults defaults = this.configuration.getDefaults();
        GlobalConfiguration global = defaults.getGlobalConfiguration().clone();

        String name = this.configuration.getName();
        // set up transport only if transport is required by some cache in the cache manager
        TransportConfiguration transport = this.configuration.getTransportConfiguration();
        FluentGlobalConfiguration.TransportConfig fluentTransport = global.fluent().transport();

        // If our transport service is running, configure Infinispan to use it
        if (context.getController().getServiceContainer().getRequiredService(getTransportServiceName(name)).getState() == ServiceController.State.UP) {
            log.debugf("Initializing %s cache container transport", name) ;

View Full Code Here

    * @deprecated Use {@link #DefaultCacheManager(org.infinispan.configuration.global.GlobalConfiguration, org.infinispan.configuration.cache.Configuration, boolean)} instead
    */
   @Deprecated
   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, caches.keySet());
      this.cacheCreateLock = new ReentrantLock();
View Full Code Here

    * @param defaultConfiguration default configuration to use. If null, a default instance is created.
    * @param start                if true, the cache manager is started
    */
   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());
      this.globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this);
View Full Code Here

      cache = null;
   }

   private ComponentsJmxRegistration buildRegistrator() {
      Set<AbstractComponentRegistry.Component> components = cache.getComponentRegistry().getRegisteredComponents();
      GlobalConfiguration configuration = cache.getConfiguration().getGlobalConfiguration();
      MBeanServer beanServer = getMBeanServer(configuration);
      ComponentsJmxRegistration registrator = new ComponentsJmxRegistration(beanServer, components, getGroupName());
      updateDomain(registrator, cache.getAdvancedCache().getComponentRegistry().getGlobalComponentRegistry(), beanServer);
      return registrator;
   }
View Full Code Here

      updateDomain(registrator, cache.getAdvancedCache().getComponentRegistry().getGlobalComponentRegistry(), beanServer);
      return registrator;
   }

   static void updateDomain(ComponentsJmxRegistration registrator, GlobalComponentRegistry componentRegistry, MBeanServer mBeanServer) {
      GlobalConfiguration gc = componentRegistry.getComponent(GlobalConfiguration.class);
      String componentName = CacheJmxRegistration.class.getName() + "_jmxDomain";
      String jmxDomain = componentRegistry.getComponent(String.class, componentName);
      if (jmxDomain == null) {
         jmxDomain = getJmxDomain(gc.getJmxDomain(), mBeanServer);
         if (!jmxDomain.equals(gc.getJmxDomain()) && !gc.isAllowDuplicateDomains()) {
            String message = "There's already an cache manager instance registered under '" + gc.getJmxDomain() +
                  "' JMX domain. If you want to allow multiple instances configured with same JMX domain enable " +
                  "'allowDuplicateDomains' attribute in 'globalJmxStatistics' config element";
            if (log.isErrorEnabled()) log.error(message);
            throw new JmxDomainConflictException(message);
         }
View Full Code Here

   public GlobalConfiguration parseGlobalConfiguration() {
      assertInitialized();
      if (gc == null) {
         Element globalElement = getSingleElementInCoreNS("global", rootElement);
         Configuration defaultConfig = parseDefaultConfiguration();
         gc = new GlobalConfiguration();
         gc.setDefaultConfiguration(defaultConfig);
         // there may not be a <global /> element in the config!!
         if (globalElement != null) {
            globalElement.normalize();
            configureAsyncListenerExecutor(getSingleElementInCoreNS("asyncListenerExecutor", globalElement), gc);
View Full Code Here

    * @param globalConfiguration  global configuration to use.  If null, a default instance is created.
    * @param defaultConfiguration default configuration to use.  If null, a default instance is created.
    * @param start                if true, the cache manager is started
    */
   public DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration, boolean start) {
      this.globalConfiguration = globalConfiguration == null ? new GlobalConfiguration() : globalConfiguration.clone();
      this.globalConfiguration.setDefaultConfiguration(defaultConfiguration == null ? new Configuration() : defaultConfiguration.clone());
      globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this);
      if (start) start();
   }
View Full Code Here

        log.debug("Starting Cache Manager initialization");
        CacheConfiguration cacheConfiguration = CacheConfiguration.getInstance();

        // Infinispan requires the bind.address system property to be set to function as a
        // distributed cache. This has been done in CarbonServerManager#initializeCarbon()
        GlobalConfiguration globalConfiguration;
        if (Boolean.toString(true).equals(
                cacheConfiguration.getProperty("configuration.clustering.enabled"))) {
            globalConfiguration = GlobalConfiguration.getClusteredDefault();
            String clusterName =
                    cacheConfiguration.getProperty("configuration.clustering.clusterName");
            if (clusterName != null) {
                globalConfiguration.setClusterName(clusterName);
            } else {
                globalConfiguration.setClusterName(DEFAULT_CLUSTER_NAME);
            }
        } else {
            globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
        }

        String ec2ConfigFile = cacheConfiguration.getProperty("configuration.ec2.configFile");
        if (ec2ConfigFile != null) {
            Properties props = new Properties();
            props.setProperty("configurationFile", ec2ConfigFile.replace("${carbon.home}",
                    carbonHome));
            globalConfiguration.setTransportProperties(props);
        }

        globalConfiguration.setAllowDuplicateDomains(true);

        Configuration configuration = new Configuration();

        String cacheMode = cacheConfiguration.getProperty("configuration.cacheMode");
        boolean sync = Boolean.toString(true).equals(
View Full Code Here

    * @return the given cache manager if it has not been registered otherwise the cache manager of the same
    * type that has already been registered..
    */
   private static synchronized EmbeddedCacheManager getUniqueInstance(String regionId, EmbeddedCacheManager manager)
   {
      GlobalConfiguration gc = manager.getGlobalConfiguration();
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      // Ensure that the cluster name won't be used between 2 ExoContainers
      gc.setClusterName(gc.getClusterName() + "_" + container.getContext().getName());
      gc.setCacheManagerName(gc.getCacheManagerName() + "_" + container.getContext().getName());
      // Configure the MBeanServerLookup
      gc.setMBeanServerLookupInstance(MBEAN_SERVER_LOOKUP);
      Configuration conf = manager.getDefaultConfiguration();
      if (CACHE_MANAGERS.containsKey(gc))
      {
         manager = CACHE_MANAGERS.get(gc);
      }
View Full Code Here

TOP

Related Classes of org.infinispan.config.GlobalConfiguration$SerializationConfig

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.