Package org.dspace.services.caching.model

Examples of org.dspace.services.caching.model.EhcacheCache


        }

        // get all caches out of the cachemanager and load them into the cache list
        List<Ehcache> ehcaches = getAllEhCaches(false);
        for (Ehcache ehcache : ehcaches) {
            EhcacheCache cache = new EhcacheCache(ehcache, null);
            cacheRecord.put(cache.getName(), cache);
        }

        // load provider
        reloadProvider();
View Full Code Here


            } catch (Exception e) {
                log.warn("Failure in provider ("+getCacheProvider()+"): " + e.getMessage());
            }
        }

        EhcacheCache cache = cacheRecord.get(cacheName);
        if (cache != null) {
            cacheManager.removeCache(cacheName);
            cacheRecord.remove(cacheName);
        } else {
            Map<String, MapCache> caches = getRequestCaches();
View Full Code Here

                log.info("Created new Cache (from default settings): " + cacheName);
            }
            ehcache = cacheManager.getEhcache(cacheName);
        }
        // wrap the ehcache in the cache impl
        EhcacheCache cache = new EhcacheCache(ehcache, cacheConfig);
        cacheRecord.put(cacheName, cache);
        return cache;
    }
View Full Code Here

    public void testEhcacheCache() {
        cacheManager.addCache("org.dspace.ehcache");
        Ehcache ehcache = cacheManager.getEhcache("org.dspace.ehcache");
        assertNotNull(ehcache);

        EhcacheCache cache = new EhcacheCache(ehcache, new CacheConfig(CacheScope.INSTANCE));
        assertEquals("org.dspace.ehcache", cache.getName());
       
        //trash the references
        ehcache = null;
        cache = null;
    }
View Full Code Here

    /**
     * Test method for {@link org.dspace.services.caching.CachingServiceImpl#instantiateEhCache(java.lang.String, org.dspace.services.model.CacheConfig)}.
     */
    @Test
    public void testInstantiateEhCache() {
        EhcacheCache cache = cachingService.instantiateEhCache("aaronz-eh", null); // make default ehcache
        assertNotNull(cache);
        assertEquals("aaronz-eh", cache.getName());
        assertNotNull(cache.getCache());
        assertEquals(0, cache.size());
        assertNotNull(cache.getConfig());
        assertEquals(cache.getConfig().getCacheScope(), CacheScope.INSTANCE);

        EhcacheCache cache2 = cachingService.instantiateEhCache("aaronz-eh", null);
        assertNotNull(cache2);
        assertEquals(cache2, cache);
       
        //trash the references
        cache = cache2 = null;
View Full Code Here

TOP

Related Classes of org.dspace.services.caching.model.EhcacheCache

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.