Package org.shiftone.cache

Examples of org.shiftone.cache.CacheFactory.newInstance()


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

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

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


            }
        }

        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

    public void testSoft() throws Exception
    {

        CacheFactory factory = new FifoCacheFactory();
        Cache        cache   = factory.newInstance("test", 10000, 10000);

        LOG.info("cache = " + cache);
        cache.addObject("test", "test");
        Thread.sleep(5000);
View Full Code Here

    public void testProxy() throws Exception
    {

        List         list    = new ArrayList();
        CacheFactory factory = new SingleCacheFactory();
        Cache        cache   = factory.newInstance("proxyTest", 1000, 1);
        List         plist   = (List) CacheProxy.newProxyInstance(list, List.class, cache);

        System.out.println(plist.size());
        System.out.println(plist.add("test1"));
        System.out.println(plist.add("test2"));
View Full Code Here

        CacheConfiguration config   = new CacheConfiguration();
        CacheFactory       factoryA = config.getCacheFactory("clusterA");
        CacheFactory       factoryB = config.getCacheFactory("clusterB");
        Cache              oneA     = factoryA.newInstance("one", 1000, 1000);
        Cache              oneB     = factoryB.newInstance("one", 1000, 1000);

        for (int i = 0; i < 1000; i++)
        {
            oneA.addObject("key" + i, "value");
            oneB.addObject("key" + i, "value");
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.