Package org.jboss.cache.config

Examples of org.jboss.cache.config.ConfigurationRegistry


      JChannelFactory cf = new JChannelFactory();
      cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
      CacheManager registry = new CacheManager(DEFAULT_CONFIGURATION_FILE, cf);
      registry.start();

      ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();

      Set<String> configNames = registry.getConfigurationNames();
      assertEquals(17, configNames.size());
      Set<String> cacheNames = registry.getCacheNames();
      assertEquals(0, cacheNames.size());

      for (String configName : configNames)
      {
         assertNull(configName + " not created", registry.getCache(configName, false));
         Cache<Object, Object> cache = registry.getCache(configName, true);
         caches.add(cache);

         // Cache shouldn't be started
         assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
         cache.create();
         cache.start();

         // Config should be a clone
         Configuration rawConfig = configRegistry.getConfiguration(configName);
         Configuration realConfig = cache.getConfiguration();
         assertFalse(rawConfig == realConfig);
         assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
      }
View Full Code Here


      JChannelFactory cf = new JChannelFactory();
      cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
      CacheManagerImpl registry = new CacheManagerImpl(DEFAULT_CONFIGURATION_FILE, cf);
      registry.start();

      ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();

      Set<String> configNames = registry.getConfigurationNames();
      assertEquals(7, configNames.size());
      Set<String> cacheNames = registry.getCacheNames();
      assertEquals(0, cacheNames.size());

      for (String configName : configNames)
      {
         assertNull(configName + " not created", registry.getCache(configName, false));
         Cache<Object, Object> cache = registry.getCache(configName, true);
         caches.add(cache);

         // Cache shouldn't be started
         assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
         cache.create();
         cache.start();

         // Config should be a clone
         Configuration rawConfig = configRegistry.getConfiguration(configName);
         Configuration realConfig = cache.getConfiguration();
         assertFalse(rawConfig == realConfig);
         assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
      }
View Full Code Here

   private CacheManager getCacheManager() throws Exception
   {
      if (cacheManager == null)
      {
         JChannelFactory channelFactory = new JChannelFactory();
         ConfigurationRegistry registry = new DependencyInjectedConfigurationRegistry();
         cacheManager = new CacheManager(registry, channelFactory);
         cacheManager.start();
      }
      return cacheManager;
   }
View Full Code Here

      cf.setExposeChannels(false);
      cf.start();
      CacheManager registry = new CacheManager(DEFAULT_CONFIGURATION_FILE, cf);
      registry.start();
     
      ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();
     
      Set<String> configNames = registry.getConfigurationNames();
      assertEquals(7, configNames.size());
      Set<String> cacheNames = registry.getCacheNames();
      assertEquals(0, cacheNames.size());
     
      for (String configName : configNames)
      {
         assertNull(configName + " not created", registry.getCache(configName, false));
         Cache<Object, Object> cache = registry.getCache(configName, true);        
         caches.add(cache);
        
         // Cache shouldn't be started
         assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
         cache.create();
         cache.start();
        
         // Config should be a clone
         Configuration rawConfig = configRegistry.getConfiguration(configName);
         Configuration realConfig = cache.getConfiguration();
         assertFalse(rawConfig == realConfig);
         assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
      }
     
View Full Code Here

      cf.setExposeChannels(false);
      cf.start();
      CacheManager registry = new CacheManager(DEFAULT_CONFIGURATION_FILE, cf);
      registry.start();
     
      ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();
     
      Set<String> configNames = registry.getConfigurationNames();
      assertEquals(7, configNames.size());
      Set<String> cacheNames = registry.getPojoCacheNames();
      assertEquals(0, cacheNames.size());
     
      for (String configName : configNames)
      {
         assertNull(configName + " not created", registry.getPojoCache(configName, false));
         PojoCache cache = registry.getPojoCache(configName, true);        
         pojoCaches.add(cache);
        
         // Cache shouldn't be started
         assertEquals(CacheStatus.INSTANTIATED, cache.getCache().getCacheStatus());
         cache.create();
         cache.start();
        
         // Config should be a clone
         Configuration rawConfig = configRegistry.getConfiguration(configName);
         Configuration realConfig = cache.getCache().getConfiguration();
         assertFalse(rawConfig == realConfig);
         assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
      }
     
View Full Code Here

      JChannelFactory cf = new JChannelFactory();
      cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
      CacheManagerImpl registry = new CacheManagerImpl(DEFAULT_CONFIGURATION_FILE, cf);
      registry.start();

      ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();

      Set<String> configNames = registry.getConfigurationNames();
      assertEquals(7, configNames.size());
      Set<String> cacheNames = registry.getCacheNames();
      assertEquals(0, cacheNames.size());

      for (String configName : configNames)
      {
         assertNull(configName + " not created", registry.getCache(configName, false));
         Cache<Object, Object> cache = registry.getCache(configName, true);
         caches.add(cache);

         // Cache shouldn't be started
         assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
         cache.create();
         cache.start();

         // Config should be a clone
         Configuration rawConfig = configRegistry.getConfiguration(configName);
         Configuration realConfig = cache.getConfiguration();
         assertFalse(rawConfig == realConfig);
         assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
      }
View Full Code Here

      JChannelFactory cf = new JChannelFactory();
      cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
      CacheManagerImpl registry = new CacheManagerImpl(DEFAULT_CONFIGURATION_FILE, cf);
      registry.start();
     
      ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();
     
      Set<String> configNames = registry.getConfigurationNames();
      assertEquals(7, configNames.size());
      Set<String> cacheNames = registry.getCacheNames();
      assertEquals(0, cacheNames.size());
     
      for (String configName : configNames)
      {
         assertNull(configName + " not created", registry.getCache(configName, false));
         Cache<Object, Object> cache = registry.getCache(configName, true);        
         caches.add(cache);
        
         // Cache shouldn't be started
         assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
         cache.create();
         cache.start();
        
         // Config should be a clone
         Configuration rawConfig = configRegistry.getConfiguration(configName);
         Configuration realConfig = cache.getConfiguration();
         assertFalse(rawConfig == realConfig);
         assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
      }
     
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.ConfigurationRegistry

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.