|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MemoryMonitorListener
Interface for receiving events from MemoryMonitor
.
As with typical listener classes, implementations should also catch and handle any Throwables generated inside these methods since MemoryMonitor has little idea how to handle them.
Implementations should be multithread safe, since MemoryMonitor makes no guarantee which thread(s) will call these methods.
Method Summary | |
---|---|
void |
close()
Called when the associated MemoryMonitor is being closed. |
void |
onMemoryLow(MemoryState state)
Called whenever the associated MemoryMonitor instance first detects the low memory state when previously it had detected a not low memory state. |
void |
onMemoryNotLow(MemoryState state)
Called whenever the associated MemoryMonitor instance first detects a not low memory state when previously it had detected the low memory state. |
void |
onMemoryState(MemoryState state)
Called whenever the associated MemoryMonitor instance has measured a new memory state. |
void |
onMonitoringError(Throwable t)
Called when the associated MemoryMonitor instance has detected some error while monitoring. |
void |
onMonitoringStarted()
Called when the associated MemoryMonitor instance has just started monitoring. |
void |
onMonitoringStopped()
Called when the associated MemoryMonitor instance has just stopped monitoring. |
Method Detail |
---|
void onMonitoringStarted()
void onMonitoringStopped()
void onMonitoringError(Throwable t)
t
- the Throwable which caused the errorvoid onMemoryState(MemoryState state)
state
- the MemoryState which was just measuredvoid onMemoryLow(MemoryState state)
state
- the MemoryState for which low memory was just detectedvoid onMemoryNotLow(MemoryState state)
state
- the MemoryState for which not low memory was just detectedvoid close()
close
in interface Closeable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |