Class BaseTable.ShiftObliviousListenerImpl

All Implemented Interfaces:
LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, ShiftObliviousListener, TableListener, NotificationQueue.Dependency, Serializable
Enclosing class:
BaseTable<IMPL_TYPE extends BaseTable<IMPL_TYPE>>

public static class BaseTable.ShiftObliviousListenerImpl extends ShiftObliviousInstrumentedListener
Simplest appropriate legacy ShiftObliviousInstrumentedListener 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. It is preferred to use BaseTable.ListenerImpl over BaseTable.ShiftObliviousListenerImpl
See Also:
  • Constructor Details

    • ShiftObliviousListenerImpl

      public ShiftObliviousListenerImpl(String description, Table parent, BaseTable<?> dependent)
  • Method Details

    • onUpdate

      public void onUpdate(RowSet added, RowSet removed, RowSet modified)
      Description copied from interface: ShiftObliviousListener
      Process notification of table changes.

      The ShiftObliviousListener 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(ShiftObliviousListener), 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:
      added - rows added
      removed - rows removed
      modified - rows modified
    • onFailureInternal

      public final 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