Class SwapListener
- All Implemented Interfaces:
- com.fishlib.base.log.LogOutputAppendable,- LivenessManager,- LivenessNode,- LivenessReferent,- Listener,- ListenerBase,- Serializable
public class SwapListener extends SwapListenerBase<Listener> implements Listener
- See Also:
- Serialized Form
- 
Field Summary
- 
Constructor SummaryConstructors Constructor Description SwapListener(com.fishlib.io.logger.Logger log, BaseTable sourceTable)
- 
Method SummaryModifier and Type Method Description voiddestroy()Attempt to release (destructively when necessary) resources held by this object.NotificationQueue.IndexUpdateNotificationgetNotification(Index added, Index removed, Index modified)Creates a notification for the table changes.voidonUpdate(Index added, Index removed, Index modified)Process notification of table changes.voidsetInitialImage(Index initialImage)Sets the index for the initial data.voidsubscribeForUpdates()InvokeDynamicTable.listenForUpdates(Listener)for the appropriate subclass ofSwapListenerBase.Methods inherited from class com.illumon.iris.db.v2.SwapListenerBaseend, getErrorNotification, makeSnapshotControl, onFailure, setListenerAndResult, startMethods inherited from class com.illumon.iris.db.util.liveness.LivenessArtifactmanageWithCurrentScope, unmanage, unmanageMethods inherited from class com.illumon.iris.db.util.liveness.ReferenceCountedLivenessNodedropReference, getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryRetainReferenceMethods inherited from class com.illumon.util.referencecounting.ReferenceCountedappend, decrementReferenceCount, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.ListenerBasegetErrorNotification, onFailureMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessManagermanage, tryManageMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessReferentdropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
- 
Constructor Details
- 
Method Details- 
onUpdateDescription copied from interface:ListenerProcess notification of table changes.The Listener onUpdate call executes within the LiveTableMonitorrefresh 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, withDynamicTable.listenForUpdates(Listener), 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.Dependencyof the listener. For listeners that reference multiple ticking tables, a common pattern is to use aMergedListenerand collection ofListenerRecorders.
- 
getNotificationpublic NotificationQueue.IndexUpdateNotification getNotification(Index added, Index removed, Index modified)Description copied from interface:ListenerCreates a notification for the table changes.- Specified by:
- getNotificationin interface- Listener
- Parameters:
- added- rows added
- removed- rows removed
- modified- rows modified
- Returns:
- table change notification
 
- 
setInitialImageDescription copied from interface:ListenerSets the index for the initial data.- Specified by:
- setInitialImagein interface- Listener
- Parameters:
- initialImage- initial image
 
- 
destroypublic void destroy()Description copied from class:ReferenceCountedLivenessNodeAttempt 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:
- destroyin class- ReferenceCountedLivenessNode
 
- 
subscribeForUpdatespublic void subscribeForUpdates()Description copied from class:SwapListenerBaseInvokeDynamicTable.listenForUpdates(Listener)for the appropriate subclass ofSwapListenerBase.- Specified by:
- subscribeForUpdatesin class- SwapListenerBase<Listener>
 
 
-