Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.http.server.filecache.jmx

public Class FileCache

extends JmxObject
Class Inheritance
Annotations
@ManagedObject
@Description:Static file caching implementation. There will be one FileCache instance per NetworkListener.
Imports
org.glassfish.grizzly.http.server.filecache.FileCacheEntry, .FileCacheProbe, org.glassfish.grizzly.monitoring.jmx.JmxObject, org.glassfish.gmbal.Description, .GmbalMBean, .ManagedAttribute, .ManagedObject, java.util.concurrent.atomic.AtomicInteger, .AtomicLong, org.glassfish.grizzly.jmxbase.GrizzlyJmxManager

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final AtomicInteger
private final AtomicInteger
cacheErrorCount

The number of cache errors.

private final AtomicLong
cacheHitCount

The number of cache hits.

private final AtomicLong
cacheMissCount

The number of cache misses.

private final FileCache
private final FileCache.JMXFileCacheProbe
fileCacheProbe

The FileCacheProbe used to track cache statistics.

Constructor Summary

AccessConstructor and Description
public
FileCache(FileCache fileCache)

Constructs a new JMX managed FileCache for the specified org.glassfish.grizzly.http.server.filecache.FileCache instance.

Method Summary

Modifier and TypeMethod and Description
public int
getCachedEntryCount()

Returns: the total number of cached entries.

public int
getCacheErrorCount()

Returns: the total number of cache errors.

public long
getCacheHitCount()

Returns: the total number of cache hits.

public long
getCacheMissCount()

Returns: the total number of cache misses.

public long
getHeapMemoryInBytes()

Returns: the total size, in bytes, of the heap memory cache.

public String
public long
getMappedMemorytInBytes()

Returns: the total size, in bytes, of the mapped memory cache.

public int
public long
public long
public long
public long
public int
public boolean
protected void
onDeregister(GrizzlyJmxManager mom)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Method will be called right after this JmxObject is unregistered by the JMX manager.

protected void
onRegister(GrizzlyJmxManager mom, GmbalMBean bean)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Method will be called right after this JmxObject is registered by the JMX manager.

Field Detail

cachedEntryCountback to summary
private final AtomicInteger cachedEntryCount

The current org.glassfish.grizzly.http.server.filecache.FileCache entry count.

cacheErrorCountback to summary
private final AtomicInteger cacheErrorCount

The number of cache errors.

cacheHitCountback to summary
private final AtomicLong cacheHitCount

The number of cache hits.

cacheMissCountback to summary
private final AtomicLong cacheMissCount

The number of cache misses.

fileCacheback to summary
private final FileCache fileCache

The org.glassfish.grizzly.http.server.filecache.FileCache being managed.

fileCacheProbeback to summary
private final FileCache.JMXFileCacheProbe fileCacheProbe

The FileCacheProbe used to track cache statistics.

Constructor Detail

FileCacheback to summary
public FileCache(FileCache fileCache)

Constructs a new JMX managed FileCache for the specified org.glassfish.grizzly.http.server.filecache.FileCache instance.

Parameters
fileCache:FileCache

the org.glassfish.grizzly.http.server.filecache.FileCache to manage.

Method Detail

getCachedEntryCountback to summary
public int getCachedEntryCount()
Returns:int

the total number of cached entries.

Annotations
@ManagedAttribute
id:cached-entries-count
@Description:The current cached entry count.
getCacheErrorCountback to summary
public int getCacheErrorCount()
Returns:int

the total number of cache errors.

Annotations
@ManagedAttribute
id:cache-error-count
@Description:The total number of cache errors.
getCacheHitCountback to summary
public long getCacheHitCount()
Returns:long

the total number of cache hits.

Annotations
@ManagedAttribute
id:cache-hit-count
@Description:The total number of cache hits.
getCacheMissCountback to summary
public long getCacheMissCount()
Returns:long

the total number of cache misses.

Annotations
@ManagedAttribute
id:cache-miss-count
@Description:The total number of cache misses.
getHeapMemoryInBytesback to summary
public long getHeapMemoryInBytes()
Returns:long

the total size, in bytes, of the heap memory cache.

Annotations
@ManagedAttribute
id:heap-cache-size-in-bytes
@Description:The current size, in bytes, of the heap memory cache.
getJmxNameback to summary
public String getJmxName()

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.getJmxName.

Annotations
@Override
getMappedMemorytInBytesback to summary
public long getMappedMemorytInBytes()
Returns:long

the total size, in bytes, of the mapped memory cache.

Annotations
@ManagedAttribute
id:mapped-memory-cache-size-in-bytes
@Description:The current size, in bytes, of the mapped memory cache.
getMaxCacheEntriesback to summary
public int getMaxCacheEntries()
Annotations
@ManagedAttribute
id:max-number-of-cache-entries
@Description:The maxumim number of entries that may exist in the cache.
See Also
org.glassfish.grizzly.http.server.filecache.FileCache#getMaxCacheEntries()
getMaxEntrySizeback to summary
public long getMaxEntrySize()
Annotations
@ManagedAttribute
id:max-entry-size
@Description:The maximum size, in bytes, a resource may be before it can no longer be considered cachable.
See Also
org.glassfish.grizzly.http.server.filecache.FileCache#getMaxEntrySize()
getMaxLargeFileCacheSizeback to summary
public long getMaxLargeFileCacheSize()
Annotations
@ManagedAttribute
id:memory-mapped-file-cache-size
@Description:The maximum size, in bytes, of the memory mapped cache for large files.
See Also
org.glassfish.grizzly.http.server.filecache.FileCache#getMaxLargeFileCacheSize()
getMaxSmallFileCacheSizeback to summary
public long getMaxSmallFileCacheSize()
Annotations
@ManagedAttribute
id:heap-file-cache-size
@Description:The maximum size, in bytes, of the heap cache for files below the water mark set by min-entry-size.
See Also
org.glassfish.grizzly.http.server.filecache.FileCache#getMaxSmallFileCacheSize()
getMinEntrySizeback to summary
public long getMinEntrySize()
Annotations
@ManagedAttribute
id:min-entry-size
@Description:The maximum size, in bytes, a file must be in order to be cached in the heap cache.
See Also
org.glassfish.grizzly.http.server.filecache.FileCache#getMinEntrySize()
getSecondsMaxAgeback to summary
public int getSecondsMaxAge()
Annotations
@ManagedAttribute
id:max-age-seconds
@Description:The maximum age, in seconds, a resource may be cached.
See Also
org.glassfish.grizzly.http.server.filecache.FileCache#getSecondsMaxAge()
isFileCacheEnabledback to summary
public boolean isFileCacheEnabled()
Annotations
@ManagedAttribute
id:file-cache-enabled
@Description:Indicates whether or not the file cache is enabled.
See Also
org.glassfish.grizzly.http.server.filecache.FileCache#isEnabled()
onDeregisterback to summary
protected void onDeregister(GrizzlyJmxManager mom)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Doc from org.glassfish.grizzly.monitoring.jmx.JmxObject.onDeregister.

Method will be called right after this JmxObject is unregistered by the JMX manager.

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

Annotations
@Override
onRegisterback to summary
protected void onRegister(GrizzlyJmxManager mom, GmbalMBean bean)

Implements abstract org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Doc from org.glassfish.grizzly.monitoring.jmx.JmxObject.onRegister.

Method will be called right after this JmxObject is registered by the JMX manager.

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

Annotations
@Override
org.glassfish.grizzly.http.server.filecache.jmx back to summary

private final Class FileCache.JMXFileCacheProbe

extends Object
implements FileCacheProbe
Class Inheritance
  • java.lang.Object
  • org.glassfish.grizzly.http.server.filecache.jmx.FileCache.JMXFileCacheProbe
All Implemented Interfaces
org.glassfish.grizzly.http.server.filecache.FileCacheProbe

JMX statistic gathering FileCacheProbe.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
onEntryAddedEvent(FileCache fileCache, FileCacheEntry entry)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryAddedEvent.

Method will be called, when file cache entry gets added.

public void
onEntryHitEvent(FileCache fileCache, FileCacheEntry entry)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryHitEvent.

Method will be called, when file cache entry gets hit.

public void
onEntryMissedEvent(FileCache fileCache, String host, String requestURI)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryMissedEvent.

Method will be called, when file cache entry is missed for some resource.

public void
onEntryRemovedEvent(FileCache fileCache, FileCacheEntry entry)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryRemovedEvent.

Method will be called, when file cache entry gets removed.

public void
onErrorEvent(FileCache fileCache, Throwable error)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onErrorEvent.

Method will be called, when error occurs on the FileCache.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JMXFileCacheProbeback to summary
private JMXFileCacheProbe()

Method Detail

onEntryAddedEventback to summary
public void onEntryAddedEvent(FileCache fileCache, FileCacheEntry entry)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryAddedEvent.

Doc from org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryAddedEvent.

Method will be called, when file cache entry gets added.

Annotations
@Override
onEntryHitEventback to summary
public void onEntryHitEvent(FileCache fileCache, FileCacheEntry entry)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryHitEvent.

Doc from org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryHitEvent.

Method will be called, when file cache entry gets hit.

Annotations
@Override
onEntryMissedEventback to summary
public void onEntryMissedEvent(FileCache fileCache, String host, String requestURI)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryMissedEvent.

Doc from org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryMissedEvent.

Method will be called, when file cache entry is missed for some resource.

Annotations
@Override
onEntryRemovedEventback to summary
public void onEntryRemovedEvent(FileCache fileCache, FileCacheEntry entry)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryRemovedEvent.

Doc from org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onEntryRemovedEvent.

Method will be called, when file cache entry gets removed.

Annotations
@Override
onErrorEventback to summary
public void onErrorEvent(FileCache fileCache, Throwable error)

Implements org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onErrorEvent.

Doc from org.glassfish.grizzly.http.server.filecache.FileCacheProbe.onErrorEvent.

Method will be called, when error occurs on the FileCache.

Annotations
@Override