final class ImplRefManager.ImplRef extends Object
Modifier and Type | Field and Description |
---|---|
private Set |
pinningTargets
targets that have pinned this reference; guarded by "this"
|
private boolean |
removed
removed from table; guarded by "lock"
|
private Remote |
strongRef
strong reference to impl, when pinned; guarded by "this"
|
private Set |
targets
targets for all exports of referenced impl; guarded by "this"
|
private Reference |
weakRef
weak reference to impl
|
Modifier | Constructor and Description |
---|---|
private |
ImplRefManager.ImplRef(Reference weakRef) |
Modifier and Type | Method and Description |
---|---|
private void |
addTarget(Target target) |
(package private) Remote |
getImpl()
Returns the referenced impl, or null if the impl has been
garbage collected.
|
private void |
invokeUnreferenced(Target target)
Asynchronously invokes the Unreferenced.unreferenced method
of the impl, if it is an instance of the Unreferenced
interface.
|
private boolean |
isPinned() |
(package private) void |
pin(Target target)
Pins this reference for the specified target, so that the
impl will be held with a strong reference.
|
(package private) void |
release(Target target)
Removes the specified target from the set of targets that
are using this ImplRef, allowing the target to be garbage
collected (and this ImplRef too, if there are no other
targets using it).
|
private void |
remove()
Removes this ImplRef from the table.
|
String |
toString() |
(package private) void |
unpin(Target target)
Unpins a previous pin of this reference.
|
private final Reference weakRef
private boolean removed
private final Set targets
private final Set pinningTargets
private Remote strongRef
private ImplRefManager.ImplRef(Reference weakRef)
private void addTarget(Target target)
Remote getImpl()
void pin(Target target)
void unpin(Target target)
private void invokeUnreferenced(Target target)
private boolean isPinned()
void release(Target target)
private void remove()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.