Examples of DefaultCacheFactory


Examples of org.jboss.cache.DefaultCacheFactory

    {
        String configResource = PropertiesHelper.getString(CACHE_RESOURCE_PROP, properties, null);
        if (configResource == null) {
          configResource = PropertiesHelper.getString(LEGACY_CACHE_RESOURCE_PROP, properties, DEFAULT_CACHE_RESOURCE);
        }
        return new DefaultCacheFactory().createCache(configResource, false);
    }
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

  private void batchTest() {
   
    Configuration config = new Configuration();
    config.setInvocationBatchingEnabled(true);
    CacheFactory factory = new DefaultCacheFactory();
    Cache cache = factory.createCache(config);
   
    cache.put("/a", "a", new Content("a"));
   
    cache.startBatch();
    cache.put("/b", "b", new Content("b"));
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

    config.setTransactionManagerLookupClass(GenericTransactionManagerLookup.class.getName());
    config.setIsolationLevel(IsolationLevel.READ_COMMITTED);
    config.setCacheMode(CacheMode.LOCAL);
    config.setLockAcquisitionTimeout(15000);
   
    CacheFactory factory = new DefaultCacheFactory();
    Cache cache = factory.createCache(config);
  }
View Full Code Here

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

Examples of org.jboss.cache.DefaultCacheFactory

    return cache;
  }

  private Cache createCacheUseClasspathXML() {

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

    return cache;
  }
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

    return cache;
  }

  private Cache createCacheUseDefault() {

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

    return cache;
  }
View Full Code Here

Examples of org.jboss.cache.DefaultCacheFactory

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

Examples of org.jboss.cache.DefaultCacheFactory

  @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

Examples of org.jboss.cache.DefaultCacheFactory

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

Examples of org.jboss.cache.DefaultCacheFactory

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