Package com.illumon.iris.db.v2
Class TableMapImpl
java.lang.Object
com.illumon.util.referencecounting.ReferenceCounted
com.illumon.iris.db.util.liveness.LivenessArtifact
com.illumon.iris.db.v2.TableMapImpl
- All Implemented Interfaces:
- com.fishlib.base.log.LogOutputAppendable,- Deflatable<TableMap>,- LivenessManager,- LivenessNode,- LivenessReferent,- DynamicNode,- TableMap,- TransformableTableMap,- Serializable
- Direct Known Subclasses:
- LocalTableMap,- TableMapClient
public abstract class TableMapImpl extends LivenessArtifact implements TableMap, DynamicNode
- See Also:
- Serialized Form
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.illumon.iris.db.v2.TableMapTableMap.KeyListener, TableMap.ListenerNested classes/interfaces inherited from interface com.illumon.iris.db.v2.TransformableTableMapTransformableTableMap.AsTableBuilder
- 
Field Summary
- 
Constructor SummaryConstructors Constructor Description TableMapImpl()
- 
Method SummaryModifier and Type Method Description voidaddKeyListener(TableMap.KeyListener listener)Listen to changes in the map's keys.voidaddListener(TableMap.Listener listener)Add a new listener for changes to the map.voidaddParentReference(Object parent)Called on a dependent node to ensure that a strong reference is maintained to any parent object that is required for the proper maintenance and functioning of the dependent.protected voiddestroy()Attempt to release (destructively when necessary) resources held by this object.voiddropReference()Drop a previously-retained reference to this referent.WeakReference<? extends LivenessReferent>getWeakReference()Get aWeakReferenceto this referent.voidinitializeTransientFieldsForLiveness()Package-private forSerializablesub-classes to use inreadObjectonly.booleanisRefreshing()Is the node updating?protected voidnotifyKeyListeners(Object key)NotifyTableMap.KeyListeners of an inserted key.protected voidnotifyListeners(Object key, Table table)NotifyTableMap.Listeners of an inserted table.protected voidonReferenceCountAtZero()Callback method that will be invoked when the reference count returns to zero.voidremoveKeyListener(TableMap.KeyListener listener)Removes a key change listener.voidremoveListener(TableMap.Listener listener)Removes a map change listener.booleansetRefreshing(boolean refreshing)Change the node's refresh mode.booleantryManage(LivenessReferent referent)Attempt to add the specified referent to this manager.booleantryRetainReference()If this referent is "live", behave asLivenessReferent.retainReference()and return true.Methods inherited from class com.illumon.iris.db.util.liveness.LivenessArtifactmanageWithCurrentScope, unmanage, unmanageMethods 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.util.liveness.LivenessManagermanage, tryManageMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessReferentdropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods inherited from interface com.illumon.iris.db.v2.TableMapapply, asTableMap, deflate, entrySet, flatten, get, getKeySet, getWithTransform, populateKeys, preemptiveUpdatesTable, size, transformTables, transformTables, transformTablesWithKey, transformTablesWithKey, transformTablesWithMap, valuesMethods inherited from interface com.illumon.iris.db.v2.TransformableTableMapasTable, asTable, asTableBuilder, merge
- 
Constructor Details- 
TableMapImplpublic TableMapImpl()
 
- 
- 
Method Details- 
addListenerDescription copied from interface:TableMapAdd a new listener for changes to the map.- Specified by:
- addListenerin interface- TableMap
- Parameters:
- listener- map change listener
 
- 
removeListenerDescription copied from interface:TableMapRemoves a map change listener.- Specified by:
- removeListenerin interface- TableMap
- Parameters:
- listener- map change listener.
 
- 
addKeyListenerDescription copied from interface:TableMapListen to changes in the map's keys.- Specified by:
- addKeyListenerin interface- TableMap
- Parameters:
- listener- key change listener
 
- 
removeKeyListenerDescription copied from interface:TableMapRemoves a key change listener.- Specified by:
- removeKeyListenerin interface- TableMap
- Parameters:
- listener- key change listener to remove
 
- 
notifyListenersNotifyTableMap.Listeners of an inserted table.- Parameters:
- key- the newly inserted key
- table- the corresponding table
 
- 
notifyKeyListenersNotifyTableMap.KeyListeners of an inserted key.- Parameters:
- key- the newly inserted key
 
- 
isRefreshingpublic boolean isRefreshing()Description copied from interface:DynamicNodeIs the node updating?- Specified by:
- isRefreshingin interface- DynamicNode
- Returns:
- true if the node is updating; false otherwise.
 
- 
setRefreshingpublic boolean setRefreshing(boolean refreshing)Description copied from interface:DynamicNodeChange the node's refresh mode.- Specified by:
- setRefreshingin interface- DynamicNode
- Parameters:
- refreshing- true to cause the node to update; false otherwise.
- Returns:
- new refreshing state
 
- 
addParentReferenceDescription copied from interface:DynamicNodeCalled on a dependent node to ensure that a strong reference is maintained to any parent object that is required for the proper maintenance and functioning of the dependent. In the most common case, the parent object is a child listener to a parent node. The parent node only keeps a weak reference to its child listener, but the listener maintains a strong reference to the parent node. In this scenario, the only strong reference to the listener (and thus indirectly to the parent node itself) is the reference kept by the dependent node.- Specified by:
- addParentReferencein interface- DynamicNode
- Parameters:
- parent- A parent of this node
 
- 
destroyprotected void destroy()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. 
- 
initializeTransientFieldsForLivenessPackage-private forSerializablesub-classes to use inreadObjectonly. Public to allow unit tests in another package to work around mock issues where the constructor is never invoked.
- 
tryRetainReferencepublic final boolean tryRetainReference()Description copied from interface:LivenessReferentIf this referent is "live", behave asLivenessReferent.retainReference()and return true. Otherwise, returns false rather than throwing an exception.- Specified by:
- tryRetainReferencein interface- LivenessReferent
- Returns:
- True if this referent was retained, false otherwise
 
- 
dropReferencepublic final void dropReference()Description copied from interface:LivenessReferentDrop a previously-retained reference to this referent.- Specified by:
- dropReferencein interface- LivenessReferent
 
- 
getWeakReferenceDescription copied from interface:LivenessReferentGet aWeakReferenceto this referent. This may be cached, or newly created.- Specified by:
- getWeakReferencein interface- LivenessReferent
- Returns:
- A new or cached reference to this referent
 
- 
tryManageDescription copied from interface:LivenessManagerAttempt to add the specified referent to this manager.- Specified by:
- tryManagein interface- LivenessManager
- Parameters:
- referent- The referent to add
- Returns:
- Whether the referent was in fact added
 
- 
onReferenceCountAtZeroprotected final void onReferenceCountAtZero()Description copied from class:ReferenceCountedCallback method that will be invoked when the reference count returns to zero.- Specified by:
- onReferenceCountAtZeroin class- ReferenceCounted
 
 
-