Class BaseTable.ListenerImpl

All Implemented Interfaces:
LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, TableListener, TableUpdateListener, NotificationQueue.Dependency, Serializable
Direct Known Subclasses:
AppendOnlyAssertionInstrumentedListenerAdapter, SnapshotInternalListener, SortedAssertionInstrumentedListenerAdapter, SortListener
Enclosing class:
BaseTable<IMPL_TYPE extends BaseTable<IMPL_TYPE>>

public static class BaseTable.ListenerImpl extends InstrumentedTableUpdateListener
Simplest appropriate InstrumentedShiftAwareListener implementation for BaseTable and descendants. It's expected that most use-cases will require overriding onUpdate() - the default implementation simply passes rowSet updates through to the dependent's listeners.
See Also:
  • Constructor Details

  • Method Details

    • onUpdate

      public void onUpdate(TableUpdate upstream)
      Description copied from interface: TableUpdateListener
      Process notification of table changes.

      The TableUpdateListener onUpdate call executes within the UpdateGraph refresh loop. Any tables used within the listener's onUpdate call must have already been refreshed. Using the typical pattern of a Listener that is listening to a single table, with Table.addUpdateListener(TableUpdateListener), this is trivially true.

      When the listener must reference more than just one parent, the tables (or other objects) it references, must be made a NotificationQueue.Dependency of the listener. For listeners that reference multiple ticking tables, a common pattern is to use a MergedListener and collection of ListenerRecorders.

      Parameters:
      upstream - The set of upstream table updates.
    • onFailureInternal

      public void onFailureInternal(Throwable originalException, TableListener.Entry sourceEntry)
      Specified by:
      onFailureInternal in class InstrumentedTableListenerBase
    • canExecute

      public boolean canExecute(long step)
      Overrides:
      canExecute in class InstrumentedTableListenerBase
    • destroy

      protected void destroy()
      Description copied from class: ReferenceCountedLivenessReferent
      Attempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().

      This is intended to only ever be used as a side effect of decreasing the reference count to 0.

      Overrides:
      destroy in class ReferenceCountedLivenessReferent
    • getParent

      protected Table getParent()
    • getDependent

      protected BaseTable<?> getDependent()