bb.util
Class MemoryMonitor.UnitTest.ListenerTest

java.lang.Object
  extended by bb.util.MemoryMonitorListenerImpl
      extended by bb.util.MemoryMonitor.UnitTest.ListenerTest
All Implemented Interfaces:
MemoryMonitorListener, Closeable
Enclosing class:
MemoryMonitor.UnitTest

private static class MemoryMonitor.UnitTest.ListenerTest
extends MemoryMonitorListenerImpl

Simple subclass of MemoryMonitorListenerImpl which can be interrogated to see if events have occured.


Field Summary
private  boolean detected_onMemoryLow
           
private  boolean detected_onMemoryNotLow
           
 
Constructor Summary
private MemoryMonitor.UnitTest.ListenerTest()
           
 
Method Summary
 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.
private  boolean onMemoryLowDetected()
           
 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.
private  boolean onMemoryNotLowDetected()
           
 
Methods inherited from class bb.util.MemoryMonitorListenerImpl
close, onMemoryState, onMonitoringError, onMonitoringStarted, onMonitoringStopped, toStringHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

detected_onMemoryLow

private volatile boolean detected_onMemoryLow

detected_onMemoryNotLow

private volatile boolean detected_onMemoryNotLow
Constructor Detail

MemoryMonitor.UnitTest.ListenerTest

private MemoryMonitor.UnitTest.ListenerTest()
Method Detail

onMemoryLow

public void onMemoryLow(MemoryState state)
                 throws RuntimeException
Description copied from interface: MemoryMonitorListener
Called whenever the associated MemoryMonitor instance first detects the low memory state when previously it had detected a not low memory state. This method will be called repeatedly if the memory cycles in and out of low memory.

Specified by:
onMemoryLow in interface MemoryMonitorListener
Overrides:
onMemoryLow in class MemoryMonitorListenerImpl
Parameters:
state - the MemoryState for which low memory was just detected
Throws:
RuntimeException

onMemoryNotLow

public void onMemoryNotLow(MemoryState state)
Description copied from interface: MemoryMonitorListener
Called whenever the associated MemoryMonitor instance first detects a not low memory state when previously it had detected the low memory state. This method will be called repeatedly if the memory cycles in and out of low memory.

Specified by:
onMemoryNotLow in interface MemoryMonitorListener
Overrides:
onMemoryNotLow in class MemoryMonitorListenerImpl
Parameters:
state - the MemoryState for which not low memory was just detected

onMemoryLowDetected

private boolean onMemoryLowDetected()
                             throws InterruptedException
Throws:
InterruptedException

onMemoryNotLowDetected

private boolean onMemoryNotLowDetected()
                                throws InterruptedException
Throws:
InterruptedException