Examples of CacheFactory


Examples of org.jboss.cache.CacheFactory

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

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

  }

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

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

    return cache;
  }

  private Cache createCacheUseDefault() {

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

    return cache;
  }
View Full Code Here

Examples of org.jboss.cache.CacheFactory

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.dashboard.database.cache.custom.CacheFactory

    public void setCacheUsage(String cacheUsage) {
        this.cacheUsage = cacheUsage;
    }

    public boolean createCustomCacheRegion(String cacheRegionName) {
        CacheFactory cacheFactory = (CacheFactory) Factory.lookup("org.jboss.dashboard.database.cache.custom.CacheFactory");
        cacheFactory.createCustomCache(cacheRegionName);
        return true;
    }
View Full Code Here

Examples of org.jboss.dashboard.database.cache.custom.CacheFactory

        cacheFactory.createCustomCache(cacheRegionName);
        return true;
    }

    public boolean freeAllCache() {
        CacheFactory cacheFactory = (CacheFactory) Factory.lookup("org.jboss.dashboard.database.cache.custom.CacheFactory");
        cacheFactory.multiCacheManager.clearAllCaches();
        return true;
    }
View Full Code Here

Examples of org.shiftone.cache.CacheFactory

    private CacheFactory     delegate;

    public Cache newInstance(String cacheName, long timeoutMs, int maxSize)
    {

        CacheFactory factory = getDelegate();
        Cache        cache   = null;

        try
        {
            cache = factory.newInstance(cacheName, timeoutMs, maxSize);

            if (factory != null)
            {
                cache = wrapDelegate(cacheName, cache);
            }
View Full Code Here

Examples of org.shiftone.cache.CacheFactory

    public static void main(String[] args) throws Exception
    {

        Cache        cache;
        CacheFactory cacheFactory;
        Class        factoryClass;
        String       factoryClassName = FifoCacheFactory.class.getName();
        int          size             = 100;
        int          ttl              = 2000;
        int          threads          = 1;      // running worker threads
        int          cycles           = 100;    // cycles per thread
        int          gpc              = 5;      // gets per cycle
        int          ppc              = 5;      // puts per cycle
        Thrasher     thrasher         = null;

        for (int i = 0; i < args.length; i++)
        {
            LOG.message("arg[ " + i + " ] = " + args[i]);
        }

        for (int i = 0; i < args.length; i++)
        {
            if ("-factory".equalsIgnoreCase(args[i]))
            {
                factoryClassName = args[++i];
            }

            if ("-size".equalsIgnoreCase(args[i]))
            {
                size = Integer.parseInt(args[++i]);
            }

            if ("-ttl".equalsIgnoreCase(args[i]))
            {
                ttl = Integer.parseInt(args[++i]);
            }

            if ("-threads".equalsIgnoreCase(args[i]))
            {
                threads = Integer.parseInt(args[++i]);
            }

            if ("-cycles".equalsIgnoreCase(args[i]))
            {
                cycles = Integer.parseInt(args[++i]);
            }

            if ("-gpc".equalsIgnoreCase(args[i]))
            {
                gpc = Integer.parseInt(args[++i]);
            }

            if ("-ppc".equalsIgnoreCase(args[i]))
            {
                ppc = Integer.parseInt(args[++i]);
            }
        }

        factoryClass = Class.forName(factoryClassName);
        cacheFactory = (CacheFactory) factoryClass.newInstance();
        cache        = cacheFactory.newInstance("thrasher", ttl, size);
        thrasher     = new Thrasher(cache, threads);

        thrasher.thrash();
    }
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.