public class LiveTableRefreshCombiner extends LivenessArtifact implements LiveTable, LiveTableRegistrar
LiveTable
s into a single one, in order to allow for update parallelization within the
LiveTableMonitor
.Constructor and Description |
---|
LiveTableRefreshCombiner() |
Modifier and Type | Method and Description |
---|---|
void |
addTable(LiveTable liveTable)
Add a table to this registrar.
|
void |
destroy()
Attempt to release (destructively when necessary) resources held by this object.
|
void |
dropReference()
Drop a previously-retained reference to this referent.
|
WeakReference<? extends LivenessReferent> |
getWeakReference()
Get a
WeakReference to this referent. |
void |
initializeTransientFieldsForLiveness()
Package-private for
Serializable sub-classes to use in readObject only. |
protected void |
onReferenceCountAtZero()
Callback method that will be invoked when the reference count returns to zero.
|
void |
refresh()
Refresh this LiveTable.
|
void |
removeTable(LiveTable liveTable)
Remove a table from this registrar.
|
boolean |
tryManage(LivenessReferent referent)
Attempt to add the specified referent to this manager.
|
boolean |
tryRetainReference()
If this referent is "live", behave as
LivenessReferent.retainReference() and return true. |
manageWithCurrentScope, unmanage, unmanage
append, decrementReferenceCount, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getReferentDescription, retainReference
manage
public void refresh()
LiveTable
public void addTable(@NotNull LiveTable liveTable)
LiveTableRegistrar
addTable
in interface LiveTableRegistrar
liveTable
- The table to addpublic void removeTable(@NotNull LiveTable liveTable)
LiveTableRegistrar
removeTable
in interface LiveTableRegistrar
liveTable
- The table to removepublic 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.
@VisibleForTesting public final void initializeTransientFieldsForLiveness()
Serializable
sub-classes to use in readObject
only.
Public to allow unit tests in another package to work around mock issues where the constructor is never invoked.public final boolean tryRetainReference()
LivenessReferent
LivenessReferent.retainReference()
and return true.
Otherwise, returns false rather than throwing an exception.tryRetainReference
in interface LivenessReferent
public final void dropReference()
LivenessReferent
dropReference
in interface LivenessReferent
public WeakReference<? extends LivenessReferent> getWeakReference()
LivenessReferent
WeakReference
to this referent. This may be cached, or newly created.getWeakReference
in interface LivenessReferent
public final boolean tryManage(@NotNull LivenessReferent referent)
LivenessManager
tryManage
in interface LivenessManager
referent
- The referent to addprotected final void onReferenceCountAtZero()
ReferenceCounted
onReferenceCountAtZero
in class ReferenceCounted