1 23 24 28 29 package com.sun.appserv.util.cache.mbeans; 30 31 import com.sun.appserv.util.cache.BoundedMultiLruCache; 32 import com.sun.appserv.util.cache.Constants; 33 39 public class JmxBoundedMultiLruCache extends JmxMultiLruCache 40 implements JmxBoundedMultiLruCacheMBean { 41 42 private BoundedMultiLruCache boundedMultiLruCache; 43 44 public JmxBoundedMultiLruCache(BoundedMultiLruCache boundedMultiLruCache, 45 String name) { 46 super(boundedMultiLruCache, name); 47 this.boundedMultiLruCache = boundedMultiLruCache; 48 } 49 50 53 public Long getCurrentSize() { 54 return (Long ) boundedMultiLruCache.getStatByName( 55 Constants.STAT_BOUNDEDMULTILRUCACHE_CURRENT_SIZE); 56 } 57 58 61 public Long getMaxSize() { 62 Object object = boundedMultiLruCache.getStatByName( 63 Constants.STAT_BOUNDEDMULTILRUCACHE_MAX_SIZE); 64 69 if(object instanceof java.lang.String && 70 ((String )object).equals(Constants.STAT_DEFAULT)) { 71 return new Long (Constants.DEFAULT_MAX_CACHE_SIZE); 72 } else { 73 return (Long )object; 74 } 75 } 76 } 77 | Popular Tags |