Package net.groboclown.retval.monitor
Interface ObservedMonitor<T>
-
- All Known Implementing Classes:
DebugObservedMonitor,MockObservedMonitor,MockProblemMonitor,NoOpObservedMonitor
public interface ObservedMonitor<T>Tracks values that have requires certain calls made. Instances are loaded into theObservedMonitorRegistrarfor use.This exists outside the objects that call here, so that they do not need to allocate information.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceObservedMonitor.ListenerA listener into the closeable object to have it tell the monitor when various object lifecycle events take place.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisTraceEnabled()Is tracing enabled? If not enabled, then more memory efficient versions of objects may be used.ObservedMonitor.ListenerregisterInstance(T instance)Register a new observable object with the monitor.
-
-
-
Method Detail
-
registerInstance
@Nonnull ObservedMonitor.Listener registerInstance(@Nonnull T instance)
Register a new observable object with the monitor. The returned value must be immutable in all but unit test environments.- Parameters:
instance- instance to register- Returns:
- a callback listener for when the close action occurs.
-
isTraceEnabled
boolean isTraceEnabled()
Is tracing enabled? If not enabled, then more memory efficient versions of objects may be used.- Returns:
- true if close tracing is enabled, false otherwise.
-
-