Package org.jboss.cache.config

Examples of org.jboss.cache.config.Configuration


        }
    }
   
    public Configuration getConfiguration(String configName)
    {
       Configuration config = null;
       synchronized (configs)
       {
          config = configs.get(configName);
       }
      
       if (config == null)
          throw new IllegalArgumentException("unknown config " + configName);
       
       // Don't hand out a ref to our master copy
       try
       {
          return config.clone();
       }
       catch (CloneNotSupportedException e)
       {
          // This should not happen, as we already cloned the config
          throw new RuntimeException("Could not clone configuration " + configName, e);
View Full Code Here


         String name = element.getAttribute(CONFIG_NAME);
         if (name == null || name.trim().length() == 0)
            throw new ConfigurationException("Element " + element + " has no name attribute");

         XmlConfigurationParser parser = new XmlConfigurationParser();
         Configuration c = parser.parseElementIgnoringRoot(element);

         // Prove that we can successfully clone it
         c = c.clone();
         result.put(name.trim(), c);
      }

      return result;
   }
View Full Code Here

      if (caches == null)
      {
         caches = new HashMap<ConfigurationKey, CacheInstance>();
         allCacheTypes.put(cacheType, caches);
      }
      Configuration cfg = cache.getConfiguration();
      ConfigurationKey key;
      try
      {
         key = new ConfigurationKey(cfg);
      }
View Full Code Here

   private TransactionManager txMgr;

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      Configuration cacheConfig = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, false);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(cacheConfig);
      txMgr = cache.getTransactionManager();
   }
View Full Code Here

      assertEquals(0, cache.getNumberOfLocksHeld());
   }

   private CacheSPI<Object, Object> createCache(Configuration.CacheMode mode, IsolationLevel level)
   {
      Configuration c = new Configuration();
      c.setCacheMode(mode);
      c.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
      c.setIsolationLevel(level);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      return (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c);
   }
View Full Code Here

   private TransactionManager txMgr;

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      Configuration cacheConfig = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, false);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(cacheConfig, false);
      cache.start();
      txMgr = cache.getTransactionManager();
   }
View Full Code Here

      return createCache(true);
   }

   public Cache<K, V> createCache(boolean start) throws ConfigurationException
   {
      return createCache(new Configuration(), start);
   }
View Full Code Here

   }

   public Cache<K, V> createCache(String configFileName, boolean start) throws ConfigurationException
   {
      XmlConfigurationParser parser = new XmlConfigurationParser();
      Configuration c;
      try
      {
         c = parser.parseFile(configFileName);
      }
      catch (ConfigurationException e)
View Full Code Here

   }

   public Cache<K, V> createCache(InputStream is) throws ConfigurationException
   {
      XmlConfigurationParser parser = new XmlConfigurationParser();
      Configuration c = null;
      try
      {
         c = parser.parseStream(is);
      }
      catch (ConfigurationException e)
View Full Code Here

   }

   public Cache<K, V> createCache(InputStream is, boolean start) throws ConfigurationException
   {
      XmlConfigurationParser parser = new XmlConfigurationParser();
      Configuration c = parser.parseStream(is);
      return createCache(c, start);
   }
View Full Code Here

TOP

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

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.