FileDocCategorySizeDatePackage
JmxBoundedMultiLruCache.javaAPI DocGlassfish v2 API3765Fri May 04 22:35:30 BST 2007com.sun.appserv.util.cache.mbeans

JmxBoundedMultiLruCache

public class JmxBoundedMultiLruCache extends JmxMultiLruCache implements JmxBoundedMultiLruCacheMBean
This class provides implementation for JmxLruCache MBean
author
Krishnamohan Meduri (Krishna.Meduri@Sun.com)

Fields Summary
private com.sun.appserv.util.cache.BoundedMultiLruCache
boundedMultiLruCache
Constructors Summary
public JmxBoundedMultiLruCache(com.sun.appserv.util.cache.BoundedMultiLruCache boundedMultiLruCache, String name)

        super(boundedMultiLruCache, name);
        this.boundedMultiLruCache = boundedMultiLruCache;
    
Methods Summary
public java.lang.LonggetCurrentSize()
Returns the current size of the cache in bytes

        return (Long) boundedMultiLruCache.getStatByName(
                                        Constants.STAT_BOUNDEDMULTILRUCACHE_CURRENT_SIZE);
    
public java.lang.LonggetMaxSize()
Returns the upper bound on the cache size

        Object object = boundedMultiLruCache.getStatByName(
                                        Constants.STAT_BOUNDEDMULTILRUCACHE_MAX_SIZE);
        /*
         * BoundedMultiLruCache class returns java.lang.String with a value 
         * "default" if the maxSize == Constants.DEFAULT_MAX_CACHE_SIZE
         * To take care of this case, the if/else is added below
         */
        if (object instanceof String &&
            ((String) object).equals(Constants.STAT_DEFAULT)) {
            return Long.valueOf(Constants.DEFAULT_MAX_CACHE_SIZE);
        }
        else {
            return (Long) object;
        }