Package org.jboss.cache

Examples of org.jboss.cache.DefaultCacheFactory


  }

  private Cache createCacheUseFilepathXML() {

    CacheFactory factory = new DefaultCacheFactory();
    Cache cache = factory.createCache(
        "/opt/configurations/cache-configuration.xml", false);
    Configuration config = cache.getConfiguration();
    config.setClusterName("Cluster Test");
    cache.create();
    cache.start();
View Full Code Here


    return cache;
  }

  private Cache createCacheUseClasspathXML() {

    CacheFactory factory = new DefaultCacheFactory();
    Cache cache = factory.createCache("cache-configuration.xml");

    return cache;
  }
View Full Code Here

    return cache;
  }

  private Cache createCacheUseDefault() {

    CacheFactory factory = new DefaultCacheFactory();
    Cache cache = factory.createCache();

    return cache;
  }
View Full Code Here

public class MyListenerTest {
 
  public void test() {
   
    CacheFactory factory = new DefaultCacheFactory();
    Cache cache = factory.createCache(false);
    MyListener myListener = new MyListener();
    cache.addCacheListener(myListener);
    System.out.println(cache.getCacheStatus());
    cache.start();
    System.out.println(cache.getCacheStatus());
View Full Code Here

  @PostConstruct
  private void init()
  {
    if (cache == null)
      cache = new DefaultCacheFactory().createCache();
//      cache = new DefaultCacheFactory().createCache(new XmlConfigurationParser(false, null).
//          parseFile("META-INF/jbosscache.xml"), true);
  }
View Full Code Here

   public void setUp()
   {
      Configuration cfg = new Configuration();
      cfg.setUseLockStriping(false);
      cfg.setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
      cache = new DefaultCacheFactory().createCache(cfg);
   }
View Full Code Here

   public void testMemConsumption() throws IOException
   {     
      int kBytesCached = (bytesPerCharacter * numNodes * (payloadSize + keySize)) / 1024;
      System.out.println("Bytes to be cached: " + NumberFormat.getIntegerInstance().format(kBytesCached) + " kb");

      Cache c = new DefaultCacheFactory().createCache(false); // default LOCAL cache
      c.start();
      for (int i = 0; i < numNodes; i++)
      {
         switch (payloadType)
         {
View Full Code Here

public class JmxManualTest
{
   public void testLocal() throws IOException
   {
      Configuration c = new Configuration();
      Cache cache = new DefaultCacheFactory().createCache(c);
      cache.put("/a/b/c", "a", "b");
      cache.put("/a/b/c", "c", "d");
      cache.put("/a/b/d", "a", "b");
      cache.put("/a/b/e", "c", "d");
View Full Code Here

   public void testLocalNoJMX() throws IOException
   {
      Configuration c = new Configuration();
      c.setExposeManagementStatistics(false);
      Cache cache = new DefaultCacheFactory().createCache(c);
      cache.put("/a/b/c", "a", "b");
      cache.put("/a/b/c", "c", "d");
      cache.put("/a/b/d", "a", "b");
      cache.put("/a/b/e", "c", "d");
View Full Code Here

      EvictionRegionConfig erc = new EvictionRegionConfig();
      erc.setEvictionAlgorithmConfig(new FIFOAlgorithmConfig(2));
      erc.setRegionFqn(Fqn.ROOT);
      ec.setDefaultEvictionRegionConfig(erc);
      c.setEvictionConfig(ec);
      Cache cache = new DefaultCacheFactory().createCache(c);
      cache.put("/a/b/c", "a", "b");
      cache.put("/a/b/c", "c", "d");
      cache.put("/a/b/d", "a", "b");
      cache.put("/a/b/e", "c", "d");
View Full Code Here

TOP

Related Classes of org.jboss.cache.DefaultCacheFactory

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.