org.jasig.cas.monitor
Class AbstractCacheMonitor

java.lang.Object
  extended by org.jasig.cas.monitor.AbstractNamedMonitor<CacheStatus>
      extended by org.jasig.cas.monitor.AbstractCacheMonitor
All Implemented Interfaces:
Monitor<CacheStatus>

public abstract class AbstractCacheMonitor
extends AbstractNamedMonitor<CacheStatus>

Abstract base class for monitors that observe cache storage systems.

Since:
3.5.1
Author:
Marvin S. Addison

Field Summary
static long DEFAULT_EVICTION_THRESHOLD
          Default eviction threshold is 0.
static int DEFAULT_WARN_FREE_THRESHOLD
          Default free capacity threshold is 10%.
 
Fields inherited from class org.jasig.cas.monitor.AbstractNamedMonitor
name
 
Constructor Summary
AbstractCacheMonitor()
           
 
Method Summary
protected abstract  CacheStatistics[] getStatistics()
           
 CacheStatus observe()
          Observes the monitored resource and reports the status.
 void setEvictionThreshold(long count)
          Sets the eviction threshold count above which an error is issued.
 void setWarnFreeThreshold(int percent)
          Sets the percent free capacity threshold below which a warning is issued.
protected  StatusCode status(CacheStatistics statistics)
          Computes the status code for a given set of cache statistics.
 
Methods inherited from class org.jasig.cas.monitor.AbstractNamedMonitor
getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WARN_FREE_THRESHOLD

public static final int DEFAULT_WARN_FREE_THRESHOLD
Default free capacity threshold is 10%.

See Also:
Constant Field Values

DEFAULT_EVICTION_THRESHOLD

public static final long DEFAULT_EVICTION_THRESHOLD
Default eviction threshold is 0.

See Also:
Constant Field Values
Constructor Detail

AbstractCacheMonitor

public AbstractCacheMonitor()
Method Detail

setWarnFreeThreshold

public void setWarnFreeThreshold(int percent)
Sets the percent free capacity threshold below which a warning is issued.

Parameters:
percent - Warning threshold percent.

setEvictionThreshold

public void setEvictionThreshold(long count)
Sets the eviction threshold count above which an error is issued.

Parameters:
count - Threshold for number of cache evictions.

observe

public CacheStatus observe()
Description copied from interface: Monitor
Observes the monitored resource and reports the status.

Returns:
Status of monitored resource.

getStatistics

protected abstract CacheStatistics[] getStatistics()

status

protected StatusCode status(CacheStatistics statistics)
Computes the status code for a given set of cache statistics.

Parameters:
statistics - Cache statistics.
Returns:
StatusCode.WARN if eviction count is above threshold or if percent free space is below threshold, otherwise StatusCode.OK.


Copyright © 2004-2013 Jasig. All Rights Reserved.