Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (C) 2007 The Guava Authors
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
Phantom reference with a finalizeReferent() method which a background thread invokes after the garbage collector reclaims the referent. This is a simpler alternative to using a java.lang.ref.ReferenceQueue.

Unlike a normal phantom reference, this reference will be cleared automatically.

Bob Lee
2.0 (imported from Google Collections Library)
public abstract class FinalizablePhantomReference<T> extends PhantomReference<T>
    implements FinalizableReference {
Constructs a new finalizable phantom reference.

referent to phantom reference
queue that should finalize the referent
  protected FinalizablePhantomReference(T referentFinalizableReferenceQueue queue) {
New to GrepCode? Check out our FAQ X