public class ManagedReference<T>
extends Object
implements Finalizable
Reference wrapper that couples a referent with a ReferenceManager cleanup lifecycle.
T - the referent type| Constructor and description |
|---|
ManagedReference(ReferenceType type, ReferenceManager rmanager, T value)Creates a managed reference using the supplied reference kind and manager. |
ManagedReference(ReferenceBundle bundle, T value)Creates a managed reference using the supplied bundle. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public final void |
clear()Clears the referent and lets the manager process any queued stale entries. |
|
public void |
finalizeReference()* Performs any cleanup required after the associated reference has been cleared. |
|
public final T |
get()Returns the current referent. |
Creates a managed reference using the supplied reference kind and manager.
type - the reference implementation to creatermanager - the manager that processes collected referencesvalue - the referent to storeCreates a managed reference using the supplied bundle.
bundle - the reference bundle describing the type and manager to usevalue - the referent to storeClears the referent and lets the manager process any queued stale entries.
* Performs any cleanup required after the associated reference has been cleared.
Returns the current referent.
null if it is no longer availableCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.