Package org.jahia.services.cache

Examples of org.jahia.services.cache.Cache


            // get the cache name
            String curCacheName = (String)cacheNameIte.next ();

            if (request.getParameter ("flush_" + curCacheName) != null) {
                Cache cache = ServicesRegistry.getInstance().getCacheService().getCache (curCacheName);
                if (cache != null) {
                    logger.info("Flushing cache: " + curCacheName);
                    cache.flush(false);
                }
            }
        }
       
        for (String cacheName : ehcacheManager.getCacheNames()) {
            if (request.getParameter ("flush_ehcache_" + cacheName) != null) {
                net.sf.ehcache.Cache cache = ehcacheManager.getCache(cacheName);
                if (cache != null) {
                    logger.info("Flushing cache: " + cacheName);
                    // flush without notifying the other cluster nodes
                    cache.removeAll(true);
                    // reset statistics
                    cache.clearStatistics();
                }
            }
        }

        displaySettings (request, response, session);
View Full Code Here


                DecimalFormat percentFormat = new DecimalFormat("###.##");
                while (cacheNameIte.hasNext()) {
                    String curCacheName = (String) cacheNameIte.next();
                    Object objectCache = ServicesRegistry.getInstance().getCacheService().getCache(curCacheName);
                    if (objectCache instanceof Cache && !(((Cache) objectCache).getCacheImplementation() instanceof org.jahia.services.cache.ehcache.EhCacheImpl)) {
                        Cache curCache = (Cache) objectCache;
                        String efficiencyStr = "0";
                        if (!Double.isNaN(curCache.getCacheEfficiency())) {
                            efficiencyStr = percentFormat.format(curCache.getCacheEfficiency());
                        }
                        strOut.println(curCacheName + ": size=" + curCache.size() + ", successful hits=" + curCache.getSuccessHits() +
                                ", total hits=" + curCache.getTotalHits() + ", efficiency=" + efficiencyStr + "%");
                    }
                }
   
                // Ehcaches
                CacheManager ehcacheManager = ((EhCacheProvider) SpringContextSingleton.getBean("ehCacheProvider")).getCacheManager();
View Full Code Here

TOP

Related Classes of org.jahia.services.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.