edu.wisc.ssec.mcidasv.monitors.memory
Class MemoryMonitor

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.monitors.memory.MemoryMonitor
All Implemented Interfaces:
Monitorable, Runnable

public class MemoryMonitor
extends Object
implements Monitorable


Field Summary
private  DecimalFormat fmt
           
private  long lastTimeRanGC
           
private  List<Monitoring> listeners
           
private  MonitorManager manager
           
private  int percentCancel
           
private  int percentThreshold
           
private  int timesAboveThreshold
           
 
Constructor Summary
MemoryMonitor(MonitorManager manager, int threshold, int cancel)
           
 
Method Summary
 void addMonitor(Monitoring listener)
           
static Color doColorThing(int percent)
           
 boolean hasMonitors()
           
 void removeMonitor(Monitoring listener)
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fmt

private final DecimalFormat fmt

manager

private final MonitorManager manager

percentThreshold

private final int percentThreshold

percentCancel

private final int percentCancel

timesAboveThreshold

private int timesAboveThreshold

lastTimeRanGC

private long lastTimeRanGC

listeners

private final List<Monitoring> listeners
Constructor Detail

MemoryMonitor

public MemoryMonitor(MonitorManager manager,
                     int threshold,
                     int cancel)
Method Detail

addMonitor

public void addMonitor(Monitoring listener)
Specified by:
addMonitor in interface Monitorable

removeMonitor

public void removeMonitor(Monitoring listener)
Specified by:
removeMonitor in interface Monitorable

hasMonitors

public boolean hasMonitors()
Specified by:
hasMonitors in interface Monitorable

run

public void run()
Specified by:
run in interface Runnable

doColorThing

public static Color doColorThing(int percent)