Package com.logicaldoc.core.system
Class SystemLoadMonitor
- java.lang.Object
-
- com.logicaldoc.core.system.SystemLoadMonitor
-
public class SystemLoadMonitor extends Object
This class monitors the system load and notifies the listeners accordingly- Since:
- 6.7.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description SystemLoadMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(SystemLoadListener listener)intgetCpuLoad()Retrieve the CPU load.booleanisAverageCpuOverLoaded()Check if the 'average' CPU load is over the limit defined in 'system.cpuload.max' config parameter.voidremoveListener(SystemLoadListener listener)voidsetConfig(ContextProperties config)voidstart()voidstop()
-
-
-
Method Detail
-
addListener
public void addListener(SystemLoadListener listener)
-
removeListener
public void removeListener(SystemLoadListener listener)
-
setConfig
public void setConfig(ContextProperties config)
-
getCpuLoad
public int getCpuLoad()
Retrieve the CPU load.- Returns:
- current CPU load
-
isAverageCpuOverLoaded
public boolean isAverageCpuOverLoaded()
Check if the 'average' CPU load is over the limit defined in 'system.cpuload.max' config parameter.- Returns:
- if the CPU is overloaded
-
stop
public void stop()
-
start
public void start()
-
-