Package net.groboclown.retval.monitor
Class ObservedMonitorRegistrar
- java.lang.Object
-
- net.groboclown.retval.monitor.ObservedMonitorRegistrar
-
public class ObservedMonitorRegistrar extends java.lang.ObjectA singleton that tracks values that have requirements around execution paths.This exists outside the objects that call here, so that they do not need to allocate information.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObservedMonitor<ProblemContainer>getCheckedInstance()static booleanisCheckedTraceEnabled()Is tracing enabled? If not enabled, then more memory efficient versions of objects may be used.static ObservedMonitor.ListenerregisterCheckedInstance(ProblemContainer instance)Register a new observable object with the monitor.static voidsetCheckedInstance(ObservedMonitor<ProblemContainer> monitor)Allow for runtime replacement of the singleton.
-
-
-
Method Detail
-
getCheckedInstance
@Nonnull public static ObservedMonitor<ProblemContainer> getCheckedInstance()
-
registerCheckedInstance
@Nonnull public static ObservedMonitor.Listener registerCheckedInstance(@Nonnull ProblemContainer 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.
-
isCheckedTraceEnabled
public static boolean isCheckedTraceEnabled()
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.
-
setCheckedInstance
public static void setCheckedInstance(@Nonnull ObservedMonitor<ProblemContainer> monitor)Allow for runtime replacement of the singleton. This is useful for testing or dynamically enabling tracing.- Parameters:
monitor- new monitor to use as the singleton.
-
-