Class ObservedMonitorRegistrar



  • public class ObservedMonitorRegistrar
    extends java.lang.Object
    A 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 Detail

      • 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.