Package org.shiftone.cache

Examples of org.shiftone.cache.Cache


    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


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

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

        try
        {
            cache = factory.newInstance(cacheName, timeoutMs, maxSize);
View Full Code Here


    public void testSimple() throws Exception
    {

        Cache cache = createCache();

        cache.getObject("A");
        cache.getObject("A");
        cache.getObject("A");
        cache.getObject("A");
        cache.getObject("A");
        cache.getObject("A");
    }
View Full Code Here


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

        Cache        delegateCache;
        ClusterCache clusterCache;

        try
        {
            init();
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");
        }

        for (int i = 0; i < 1000; i++)
        {
            oneA.remove("key" + i);
View Full Code Here

    private CacheFactory     delegateB;

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

        Cache   cacheA = delegateA.newInstance(cacheName, timeoutMilliSeconds, maxSize);
        Cache   cacheB = delegateB.newInstance(cacheName, timeoutMilliSeconds, maxSize);
        Cache[] caches = { cacheA, cacheB };

        return (allGets)
               ? new TandemAllGetsCache(caches)
               : new TandemCache(caches);
View Full Code Here

TOP

Related Classes of org.shiftone.cache.Cache

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.