org.glassfish.grizzly.http.server.filecache.jmx
Class FileCache

java.lang.Object
  extended by org.glassfish.grizzly.monitoring.jmx.JmxObject
      extended by org.glassfish.grizzly.http.server.filecache.jmx.FileCache

@ManagedObject
@Description(value="Static file caching implementation.  There will be one FileCache instance per NetworkListener.")
public class FileCache
extends JmxObject

This class provides a JMX view of the current operating state of the FileCache.

Since:
2.0

Constructor Summary
FileCache(FileCache fileCache)
          Constructs a new JMX managed FileCache for the specified FileCache instance.
 
Method Summary
 int getCachedEntryCount()
           
 int getCacheErrorCount()
           
 long getCacheHitCount()
           
 long getCacheMissCount()
           
 long getHeapMemoryInBytes()
           
 String getJmxName()
          
 long getMappedMemorytInBytes()
           
 int getMaxCacheEntries()
           
 long getMaxEntrySize()
           
 long getMaxLargeFileCacheSize()
           
 long getMaxSmallFileCacheSize()
           
 long getMinEntrySize()
           
 int getSecondsMaxAge()
           
 boolean isFileCacheEnabled()
           
protected  void onRegister(GrizzlyJmxManager mom, org.glassfish.gmbal.GmbalMBean bean)
          
protected  void onUnregister(GrizzlyJmxManager mom)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCache

public FileCache(FileCache fileCache)
Constructs a new JMX managed FileCache for the specified FileCache instance.

Parameters:
fileCache - the FileCache to manage.
Method Detail

getJmxName

public String getJmxName()

Specified by:
getJmxName in class JmxObject

onRegister

protected void onRegister(GrizzlyJmxManager mom,
                          org.glassfish.gmbal.GmbalMBean bean)

When invoked, this method will add a FileCacheProbe to track statistics.

Specified by:
onRegister in class JmxObject

onUnregister

protected void onUnregister(GrizzlyJmxManager mom)

When invoked, this method will remove the FileCacheProbe added by the onRegister(org.glassfish.grizzly.monitoring.jmx.GrizzlyJmxManager, org.glassfish.gmbal.GmbalMBean) call.

Specified by:
onUnregister in class JmxObject

isFileCacheEnabled

@ManagedAttribute(id="file-cache-enabled")
@Description(value="Indicates whether or not the file cache is enabled.")
public boolean isFileCacheEnabled()
See Also:
FileCache.isEnabled()

getSecondsMaxAge

@ManagedAttribute(id="max-age-seconds")
@Description(value="The maximum age, in seconds, a resource may be cached.")
public int getSecondsMaxAge()
See Also:
FileCache.getSecondsMaxAge()

getMaxCacheEntries

@ManagedAttribute(id="max-number-of-cache-entries")
@Description(value="The maxumim number of entries that may exist in the cache.")
public int getMaxCacheEntries()
See Also:
FileCache.getMaxCacheEntries()

getMinEntrySize

@ManagedAttribute(id="min-entry-size")
@Description(value="The maximum size, in bytes, a file must be in order to be cached in the heap cache.")
public long getMinEntrySize()
See Also:
FileCache.getMinEntrySize()

getMaxEntrySize

@ManagedAttribute(id="max-entry-size")
@Description(value="The maximum size, in bytes, a resource may be before it can no longer be considered cachable.")
public long getMaxEntrySize()
See Also:
FileCache.getMaxEntrySize()

getMaxLargeFileCacheSize

@ManagedAttribute(id="memory-mapped-file-cache-size")
@Description(value="The maximum size, in bytes, of the memory mapped cache for large files.")
public long getMaxLargeFileCacheSize()
See Also:
FileCache.getMaxLargeFileCacheSize()

getMaxSmallFileCacheSize

@ManagedAttribute(id="heap-file-cache-size")
@Description(value="The maximum size, in bytes, of the heap cache for files below the water mark set by min-entry-size.")
public long getMaxSmallFileCacheSize()
See Also:
FileCache.getMaxSmallFileCacheSize()

getCachedEntryCount

@ManagedAttribute(id="cached-entries-count")
@Description(value="The current cached entry count.")
public int getCachedEntryCount()
Returns:
the total number of cached entries.

getCacheHitCount

@ManagedAttribute(id="cache-hit-count")
@Description(value="The total number of cache hits.")
public long getCacheHitCount()
Returns:
the total number of cache hits.

getCacheMissCount

@ManagedAttribute(id="cache-miss-count")
@Description(value="The total number of cache misses.")
public long getCacheMissCount()
Returns:
the total number of cache misses.

getCacheErrorCount

@ManagedAttribute(id="cache-error-count")
@Description(value="The total number of cache errors.")
public int getCacheErrorCount()
Returns:
the total number of cache errors.

getHeapMemoryInBytes

@ManagedAttribute(id="heap-cache-size-in-bytes")
@Description(value="The current size, in bytes, of the heap memory cache.")
public long getHeapMemoryInBytes()
Returns:
the total size, in bytes, of the heap memory cache.

getMappedMemorytInBytes

@ManagedAttribute(id="mapped-memory-cache-size-in-bytes")
@Description(value="The current size, in bytes, of the mapped memory cache.")
public long getMappedMemorytInBytes()
Returns:
the total size, in bytes, of the mapped memory cache.


Copyright © 2010 Oracle Corpration. All Rights Reserved.