org.norther.tammi.core.monitor
Interface CacheMonitor

All Superinterfaces:
CacheClient, Executable, Refreshable, Runnable, Startable
All Known Implementing Classes:
DefaultCacheMonitor

public interface CacheMonitor
extends Executable, CacheClient

An interface that extends CacheClient to control and monitor other registered cache clients.

Author:
Marketta Priha

Method Summary
 void gc()
          Runs the garbage collector.
 float getExpirationFraction()
          Gets the fraction of cached entries to expire when running low in memory.
 long getExpirationThreshold()
          Gets the threshold of available memory below which caches are expired.
 long getFreeMemory()
          Gets the amount of free memory in bytes.
 long getMaxMemory()
          Gets max amount of memory in bytes.
 long getTotalMemory()
          Gets total amount of memory in bytes.
 String logMemoryStatus()
          Logs memory status using the info logger.
 void setExpirationFraction(float frac)
          Sets the fraction of cached entries to expire when running low in memory.
 void setExpirationThreshold(long thresh)
          Sets the threshold of available memory below which caches are expired.
 
Methods inherited from interface org.norther.tammi.core.thread.Executable
getExecutorName, setExecutorName
 
Methods inherited from interface org.norther.tammi.core.base.Startable
isStarted, start, stop
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface org.norther.tammi.core.cache.CacheClient
clearCached, expireCached, expireFraction, getCache, isCachingDisabled, removeCache, setCachingDisabled
 
Methods inherited from interface org.norther.tammi.core.base.Refreshable
getRefreshed, refresh
 

Method Detail

getMaxMemory

long getMaxMemory()
Gets max amount of memory in bytes.

Returns:
the max amount of memory in bytes.

getTotalMemory

long getTotalMemory()
Gets total amount of memory in bytes.

Returns:
the total amount of memory in bytes.

getFreeMemory

long getFreeMemory()
Gets the amount of free memory in bytes.

Returns:
the amount of free memory in bytes.

getExpirationThreshold

long getExpirationThreshold()
Gets the threshold of available memory below which caches are expired.

Returns:
the cache expiration threshold in bytes.

setExpirationThreshold

void setExpirationThreshold(long thresh)
Sets the threshold of available memory below which caches are expired.

Parameters:
thresh - the cache expiration threshold in bytes.

getExpirationFraction

float getExpirationFraction()
Gets the fraction of cached entries to expire when running low in memory.

Returns:
the cache expiration fraction (0.0..1.0).

setExpirationFraction

void setExpirationFraction(float frac)
Sets the fraction of cached entries to expire when running low in memory.

Parameters:
frac - the cache expiration fraction (0.0..1.0).

logMemoryStatus

String logMemoryStatus()
Logs memory status using the info logger.

Returns:
the memory status.

gc

void gc()
Runs the garbage collector.



Copyright © 2004 The Norther Organization. All rights reserved.