Class InstrumentedListenerBase

All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, NotificationQueue.Dependency, LivenessManager, LivenessNode, LivenessReferent, ListenerBase, Serializable
Direct Known Subclasses:
InstrumentedListener, InstrumentedShiftAwareListener

public abstract class InstrumentedListenerBase extends LivenessArtifact implements ListenerBase, NotificationQueue.Dependency
The basis for listener implementations.
See Also:
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class ReferenceCounted
    • setVerboseLogging

      public static boolean setVerboseLogging(boolean enableVerboseLogging)
      Enable or disable verbose logging for all InstrumentedListeners
      Parameters:
      enableVerboseLogging - true if verbose logging should be enabled
      Returns:
      the previous setting for verbose logging.
    • getEntry

      public UpdatePerformanceTracker.Entry getEntry()
      Get the entry that describes the operation this listener is for.
      Returns:
      the UpdatePerformanceTracker.Entry object.
    • getErrorNotification

      public NotificationQueue.Notification getErrorNotification(Throwable originalException, UpdatePerformanceTracker.Entry sourceEntry)
      Description copied from interface: ListenerBase
      Creates a notification for the exception.
      Specified by:
      getErrorNotification in interface ListenerBase
      Parameters:
      originalException - exception
      sourceEntry - performance tracking
      Returns:
      exception notification
    • append

      public com.fishlib.base.log.LogOutput append(@NotNull com.fishlib.base.log.LogOutput logOutput)
      Specified by:
      append in interface com.fishlib.base.log.LogOutputAppendable
      Overrides:
      append in class ReferenceCounted
    • canExecute

      public boolean canExecute(long step)
      Check if this listener is ready to execute.
      Returns:
      if this listener is ready to execute
    • satisfied

      public boolean satisfied(long step)
      Description copied from interface: NotificationQueue.Dependency
      Is this ancestor satisfied? Note that this method must be safe to call on any thread.
      Specified by:
      satisfied in interface NotificationQueue.Dependency
      Parameters:
      step - The step for which we are testing satisfaction
      Returns:
      Whether the dependency is satisfied on step (and will not fire subsequent notifications)
    • onFailure

      public void onFailure(Throwable originalException, UpdatePerformanceTracker.Entry sourceEntry)
      Description copied from interface: ListenerBase
      Notification of exceptions.
      Specified by:
      onFailure in interface ListenerBase
      Parameters:
      originalException - exception
      sourceEntry - performance tracking
    • onFailureInternal

      protected abstract void onFailureInternal(Throwable originalException, UpdatePerformanceTracker.Entry sourceEntry)
    • onFailureInternalWithDependent

      protected final void onFailureInternalWithDependent(DynamicTable dependent, Throwable originalException, UpdatePerformanceTracker.Entry sourceEntry)