1 16 package net.sf.dozer.util.mapping.jmx; 17 18 import net.sf.dozer.util.mapping.cache.CacheManagerIF; 19 import net.sf.dozer.util.mapping.cache.DozerCacheManager; 20 import net.sf.dozer.util.mapping.config.GlobalSettings; 21 import net.sf.dozer.util.mapping.config.Settings; 22 import net.sf.dozer.util.mapping.util.MapperConstants; 23 24 27 public class DozerAdminController implements DozerAdminControllerMBean { 28 private final CacheManagerIF cacheMgr = DozerCacheManager.getInstance(); 29 private final Settings globalSettings = GlobalSettings.getInstance().getSettings(); 30 31 public String getCurrentVersion() { 32 return MapperConstants.CURRENT_VERSION; 33 } 34 35 public void clearGlobalCaches() { 36 cacheMgr.clearAllEntries(); 37 } 38 39 public boolean isStatisticsEnabled() { 40 return globalSettings.isStatisticsEnabled(); 41 } 42 43 public void setStatisticsEnabled(boolean statisticsEnabled) { 44 globalSettings.setStatisticsEnabled(statisticsEnabled); 45 } 46 47 public void logGlobalCaches() { 48 cacheMgr.logCaches(); 49 } 50 } 51 | Popular Tags |