Package org.jboss.cache.config

Examples of org.jboss.cache.config.Configuration


    *
    * @throws Exception
    */
   public void testPrintConfigurationAsHtml2() throws Exception
   {
      Configuration cfg = createConfiguration();
      CacheJmxWrapperMBean<String, String> wrapper = registerWrapper(cfg);
      wrapper.create();
      wrapper.start();
      String cfgFromJmx = wrapper.printConfigurationAsHtmlString();
      assertEquals(CachePrinter.formatHtml(wrapper.getCache().getConfiguration().toString()), cfgFromJmx);
View Full Code Here


   }

   @Test
   public void testGetMembers() throws Exception
   {
      Configuration c = createConfiguration();
      c.setCacheMode(CacheMode.REPL_ASYNC);
      // This cache instance does not go through UnitTestCacheFactory so we need to modify
      // it's config explicitelly.
      new UnitTestCacheFactory<String, String>().mangleConfiguration(c);
      CacheJmxWrapperMBean<String, String> wrapper = registerWrapper(c);
      wrapper.start();
View Full Code Here

      return details;
   }

   private String printLockInfoTest(boolean html) throws Exception
   {
      Configuration config = createConfiguration();
      config.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      Cache<String, String> c = createCache(config);
      CacheJmxWrapperMBean<String, String> wrapper = registerWrapper(c);

//      wrapper.setManageCacheLifecycle(true);
      wrapper.create();
      wrapper.start();

      TransactionManager tm = config.getRuntimeConfig().getTransactionManager();

      tm.begin();
      try
      {
         Fqn fqn = Fqn.fromString("/testing/jmx");
View Full Code Here

   protected boolean useRegionBasedMarshalling = false;


   protected void createCaches() throws Throwable
   {
      Configuration c1 = new Configuration();
      Configuration c2 = new Configuration();
      c1.setStateRetrievalTimeout(2000);
      c2.setStateRetrievalTimeout(2000);
      c1.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      c2.setCacheMode(Configuration.CacheMode.REPL_SYNC);

      c1.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", "org.jboss.cache.loader.ClusteredCacheLoader",
            "timeout=5000", false, false, false, false, false));
      c2.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", "org.jboss.cache.loader.ClusteredCacheLoader",
            "timeout=5000", false, false, false, false, false));

      c1.setUseRegionBasedMarshalling(useRegionBasedMarshalling);
      c2.setUseRegionBasedMarshalling(useRegionBasedMarshalling);
     
     
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c1, false, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c2, false, getClass());
      cache1.getConfiguration().setSerializationExecutorPoolSize(0);
View Full Code Here

   protected NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC;

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      Configuration c = new Configuration();
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      c.setNodeLockingScheme(nodeLockingScheme);
      UnitTestCacheFactory<String, String> instance = new UnitTestCacheFactory<String, String>();
      cache = (CacheSPI<String, String>) instance.createCache(c, getClass());
      tm = cache.getTransactionManager();
   }
View Full Code Here

   private Fqn fqn = Fqn.fromString("/a");

   @BeforeMethod
   public void setUp()
   {
      Configuration c = new Configuration();
      c.setSyncCommitPhase(true);
      c.setSyncRollbackPhase(true);
      c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());     
      cache1 = new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());

      c = new Configuration();
      c.setSyncCommitPhase(true);
      c.setSyncRollbackPhase(true);
      c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache2 = new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());
   }
View Full Code Here

   private TransactionManager m;

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      Configuration config = new Configuration();
      config.setCacheMode(Configuration.CacheMode.LOCAL);
      config.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      UnitTestCacheFactory<String, String> instance = new UnitTestCacheFactory<String, String>();
      config.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
      cache = (CacheSPI<String, String>) instance.createCache(config, getClass());
      m = cache.getTransactionManager();
   }
View Full Code Here

      }
   }

   private CacheSPI<Object, Object> createCache(String clusterName) throws Exception
   {
      Configuration config = createConfiguration(clusterName);
      config.setCacheMode(CacheMode.LOCAL);
      UnitTestCacheFactory<Object, Object> factory = new UnitTestCacheFactory<Object, Object>();
      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) factory.createCache(config, false, getClass());

      cache.create();
      // start the cache after the listener has been registered
View Full Code Here

      return cache;
   }

   protected Configuration createConfiguration(String clusterName) throws Exception
   {
      Configuration config = UnitTestConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC);
      config.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      config.setCacheLoaderConfig(getCacheLoaderConfig("location=" + getTempDir()));
      config.setExposeManagementStatistics(true);
      config.setClusterName(clusterName);
      if (optimistic)
      {
         config.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
         config.setNodeLockingScheme("OPTIMISTIC");
      }

      return config;
   }
View Full Code Here

       */
   }

   private void initCaches()
   {
      Configuration conf1 = new Configuration();
      Configuration conf2 = new Configuration();
     
      conf1.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      conf2.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      conf1.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      conf2.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      conf1.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
      conf2.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);

      conf1.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      conf2.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      /*
       cache1.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
       cache2.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
       */
      conf1.setLockAcquisitionTimeout(5000);
      conf2.setLockAcquisitionTimeout(5000);
     
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(conf1, false, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(conf2, false, getClass());

      cache1.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.