performCleanup()
method
to provide the cleaning action.
When constructed, the object reference and the Cleanable
are registered with the Cleaner
.
The Cleaner invokes clean
after the
referent becomes phantom reachable.
Modifier and Type | Field and Description |
---|---|
private final PhantomCleanable | list
The list of PhantomCleanable; synchronizes insert and remove. |
pack-priv PhantomCleanable | next
Hides java. |
pack-priv PhantomCleanable | prev
Links to previous and next in a doubly-linked list. |
Access | Constructor and Description |
---|---|
public | PhantomCleanable(T
the referent to track referent, Cleaner the cleaner)Cleaner to register withConstructs new |
pack-priv |
Modifier and Type | Method and Description |
---|---|
public final void | clean()
Implements java. Unregister this PhantomCleanable and invoke |
public void | clear()
Overrides java. Unregister this PhantomCleanable and clear the reference. |
public final boolean | enqueue()
Overrides java. This method always throws |
private void | |
public final boolean | isEnqueued()
Overrides java. This method always throws |
pack-priv boolean | Returns: true if the list is emptyReturns true if the list's next reference refers to itself. |
protected abstract void | |
private boolean | Returns: true if Cleanable was removed or false if not because it had already been removed beforeRemove this PhantomCleanable from the list. |
list | back to summary |
---|---|
private final PhantomCleanable<?> list The list of PhantomCleanable; synchronizes insert and remove. |
next | back to summary |
---|---|
pack-priv PhantomCleanable<?> next Hides java. Links to previous and next in a doubly-linked list. |
prev | back to summary |
---|---|
pack-priv PhantomCleanable<?> prev Links to previous and next in a doubly-linked list. |
PhantomCleanable | back to summary |
---|---|
public PhantomCleanable(T referent, Cleaner cleaner) Constructs new
|
PhantomCleanable | back to summary |
---|---|
pack-priv PhantomCleanable() Construct a new root of the list; not inserted. |
clean | back to summary |
---|---|
public final void clean() Implements java. Unregister this PhantomCleanable and invoke
|
clear | back to summary |
---|---|
public void clear() Overrides java. Unregister this PhantomCleanable and clear the reference.
Due to inherent concurrency,
|
enqueue | back to summary |
---|---|
public final boolean enqueue() Overrides java. This method always throws
|
insert | back to summary |
---|---|
private void insert() Insert this PhantomCleanable after the list head. |
isEnqueued | back to summary |
---|---|
public final boolean isEnqueued() Overrides java. This method always throws
|
isListEmpty | back to summary |
---|---|
pack-priv boolean isListEmpty() Returns true if the list's next reference refers to itself.
|
performCleanup | back to summary |
---|---|
protected abstract void performCleanup() The |
remove | back to summary |
---|---|
private boolean remove() Remove this PhantomCleanable from the list.
|