Package tenapull.sync
Interface InstancesTracker.KeyFinalizer<K extends InstancesTracker.KeyFinalizer<K,I>,I>
- Type Parameters:
K
- The key type implementing KeyFinalizerI
- the instance type associated with the keyFinalizer implementation
- All Known Implementing Classes:
WeakInstancesTracker.WeakRef
- Enclosing class:
- InstancesTracker<K,I>
public static interface InstancesTracker.KeyFinalizer<K extends InstancesTracker.KeyFinalizer<K,I>,I>
The interface Key finalizer, which may be implemented by custom keys.
If the key type implements key finalizer, this method will be invoked
immediately after a createLock is "finalized" -- meaning that the finished instance
is moved from the underConstruction map where it is a strong reference held
by the CreateLock under which it was constructed, to the instances map where it is
a weak reference associated with a set of keys.
Note that finalizing happens asynchronously from the completion of construction,
and that the finished instance may be returned long before finalizing happens
-
Method Summary
Modifier and Type Method Description void
finalizeKey(I instance)
Method invoked immediately after finalization is completed.
-
Method Details
-
finalizeKey
Method invoked immediately after finalization is completed.- Parameters:
instance
- the instance that was finalized, meaning moved from underConstruction to instances
-