Examples of GlobalConfiguration


Examples of org.infinispan.config.GlobalConfiguration

   AdvancedCache advanced;
   private static final String JMX_DOMAIN = CacheMgmtInterceptorMBeanTest.class.getSimpleName();

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
      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);
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

    * @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(configurationValidator);
      this.defaultConfiguration = defaultConfiguration == null ? new Configuration() : defaultConfiguration.clone();
      this.globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, reflectionCache, caches.keySet());
      this.cacheCreateLock = new ReentrantLock();
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

  
    private DefaultCacheManager cacheManager;
    private ContextTrackingService contextTracking;

    public DistributedMapPeristenceService() {
        GlobalConfiguration globalConf = GlobalConfiguration.getClusteredDefault();
        Configuration cfg = new Configuration();
        cfg.setCacheMode(Configuration.CacheMode.DIST_SYNC);
        cfg.setNumOwners(3);
        cacheManager = new DefaultCacheManager(globalConf, cfg);
        contextTracking = ContextTrackingProvider.getTrackingService();
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

    * @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(configurationValidator);
      this.defaultConfiguration = defaultConfiguration == null ? new Configuration() : defaultConfiguration.clone();
      this.globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, reflectionCache, caches.keySet());
      this.cacheCreateLock = new ReentrantLock();
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

    * @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, reflectionCache);
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

      return registrar;
   }
  
   protected void updateDomain(ComponentsJmxRegistration registrar, GlobalComponentRegistry componentRegistry,
                               MBeanServer mBeanServer, String groupName) {
      GlobalConfiguration gc = componentRegistry.getComponent(GlobalConfiguration.class);
      CacheManagerJmxRegistration managerJmxReg = componentRegistry.getComponent(CacheManagerJmxRegistration.class);
      if (!gc.isExposeGlobalJmxStatistics() && jmxDomain == null) {
         String tmpJmxDomain = getJmxDomain(gc.getJmxDomain(), mBeanServer, groupName);
         synchronized (managerJmxReg) {
            if (managerJmxReg.jmxDomain == null) {
               if (!tmpJmxDomain.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);
               }
               // Set manager component's jmx domain so that other caches under same manager
               // can see it, particularly important when jmx is only enabled at the cache level
               managerJmxReg.jmxDomain = tmpJmxDomain;
            }
            // So that all caches share the same domain, regardless of whether dups are
            // allowed or not, simply assign the manager's calculated jmxDomain
            jmxDomain = managerJmxReg.jmxDomain;
         }
      } else {
         // If global stats were enabled, manager's jmxDomain would have been populated
         // when cache manager was started, so no need for synchronization here.
         jmxDomain = managerJmxReg.jmxDomain == null ? gc.getJmxDomain() : managerJmxReg.jmxDomain;
      }
      registrar.setJmxDomain(jmxDomain);
   }
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

   @Start(priority = 20)
   public void start() throws Exception {
      log.trace("Starting distribution manager on " + getMyAddress());           
      listener = new ViewChangeListener();
      notifier.addListener(listener);
      GlobalConfiguration gc = configuration.getGlobalConfiguration();
      if (gc.hasTopologyInfo()) {
         Address address = rpcManager.getTransport().getAddress();
         NodeTopologyInfo nti = new NodeTopologyInfo(gc.getMachineId(),gc.getRackId(), gc.getSiteId(), address);
         topologyInfo.addNodeTopologyInfo(address, nti);
      }
      join();
   }
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

            IOException {
      final ConfigurationContainer templateConfiguration;
      if (this.configurationFileLocation == null) {
         this.logger
                  .info("No configuration file has been given. Using Infinispan's default settings.");
         final GlobalConfiguration standardGlobalConfiguration = new GlobalConfiguration();
         final Configuration standardDefaultConfiguration = new Configuration();
         templateConfiguration = new ConfigurationContainer(standardGlobalConfiguration,
                  standardDefaultConfiguration, new HashMap<String, Configuration>());
      } else {
         this.logger.info("Using Infinispan configuration file located at ["
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

    * @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(configurationValidator);
      this.defaultConfiguration = defaultConfiguration == null ? new Configuration() : defaultConfiguration.clone();
      this.globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, reflectionCache, caches.keySet());
      this.cacheCreateLock = new ReentrantLock();
View Full Code Here

Examples of org.infinispan.config.GlobalConfiguration

      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
TOP
Copyright © 2018 www.massapi.com. 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.