Package net.groboclown.retval.monitor
Class NoOpObservedMonitor<T>
- java.lang.Object
-
- net.groboclown.retval.monitor.NoOpObservedMonitor<T>
-
- All Implemented Interfaces:
ObservedMonitor<T>
public class NoOpObservedMonitor<T> extends java.lang.Object implements ObservedMonitor<T>
A monitor that performs no actual monitoring.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.groboclown.retval.monitor.ObservedMonitor
ObservedMonitor.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static net.groboclown.retval.monitor.NoOpObservedMonitor.NoOpListenerLISTENER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> NoOpObservedMonitor<T>getInstance()Type-cast the placeholder No Op implementation to the needed format.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
-
getInstance
@Nonnull public static <T> NoOpObservedMonitor<T> getInstance()
Type-cast the placeholder No Op implementation to the needed format.- Type Parameters:
T- required type value- Returns:
- the static instance
-
registerInstance
@Nonnull public ObservedMonitor.Listener registerInstance(@Nonnull T instance)
Description copied from interface:ObservedMonitorRegister a new observable object with the monitor. The returned value must be immutable in all but unit test environments.- Specified by:
registerInstancein interfaceObservedMonitor<T>- Parameters:
instance- instance to register- Returns:
- a callback listener for when the close action occurs.
-
isTraceEnabled
public boolean isTraceEnabled()
Description copied from interface:ObservedMonitorIs tracing enabled? If not enabled, then more memory efficient versions of objects may be used.- Specified by:
isTraceEnabledin interfaceObservedMonitor<T>- Returns:
- true if close tracing is enabled, false otherwise.
-
-