Back to Fresco

FinalizerCloseableReference

docs/javadoc/reference/com/facebook/common/references/FinalizerCloseableReference.html

3.6.020.3 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Exceptions

Packages | Classes

Summary: Inherited Constants | Inherited Fields | Methods | Protected Methods | Inherited Methods | [Expand All]

public class

FinalizerCloseableReference

extends CloseableReference<T>

| java.lang.Object | | ↳ | com.facebook.common.references.CloseableReference<T> | | | ↳ | com.facebook.common.references.FinalizerCloseableReference<T> |

Summary

| [Expand] Inherited Constants | | --- | | From class com.facebook.common.references.CloseableReference

| int | REF_TYPE_DEFAULT | | | int | REF_TYPE_FINALIZER | | | int | REF_TYPE_NOOP | | | int | REF_TYPE_REF_COUNT | |

|

| [Expand] Inherited Fields | | --- | | From class com.facebook.common.references.CloseableReference

| protected boolean | mIsClosed | | | protected final CloseableReference.LeakHandler | mLeakHandler | | | protected final SharedReference<T> | mSharedReference | | | protected final Throwable | mStacktrace | |

|

Public Methods
CloseableReference<T>
Returns a new CloseableReference to the same underlying SharedReference.
void
Closes this CloseableReference.
Protected Methods
void

| [Expand] Inherited Methods | | --- | | From class com.facebook.common.references.CloseableReference

| abstract CloseableReference<T> | clone() Returns a new CloseableReference to the same underlying SharedReference. | | static <T> CloseableReference<T> | cloneOrNull(CloseableReference<T> ref) Returns the cloned reference if valid, null otherwise. | | static <T> List<CloseableReference<T>> | cloneOrNull(Collection<CloseableReference<T>> refs) Clones a collection of references and returns a list. | | synchronized CloseableReference<T> | cloneOrNull() | | void | close() Closes this CloseableReference. | | static void | closeSafely(Iterable<? extends CloseableReference<?>> references) Closes the references in the iterable handling null. | | static void | closeSafely(CloseableReference<?> ref) Closes the reference handling null. | | void | finalize() | | synchronized T | get() Returns the underlying Closeable if this reference is not closed yet. | | synchronized SharedReference<T> | getUnderlyingReferenceTestOnly() A test-only method to get the underlying references. | | int | getValueHash() Method used for tracking Closeables pointed by CloseableReference. | | synchronized boolean | isValid() Checks if this closable-reference is valid i.e. | | static boolean | isValid(CloseableReference<?> ref) Checks if the closable-reference is valid i.e. | | static <T extends Closeable> CloseableReference<T> | of(T t) Constructs a CloseableReference. | | static <T> CloseableReference<T> | of(T t, ResourceReleaser<T> resourceReleaser) Constructs a CloseableReference (wrapping a SharedReference) of T with provided ResourceReleaser. | | static <T> CloseableReference<T> | of(T t, ResourceReleaser<T> resourceReleaser, CloseableReference.LeakHandler leakHandler) | | static <T> CloseableReference<T> | of(T t, ResourceReleaser<T> resourceReleaser, CloseableReference.LeakHandler leakHandler, Throwable stacktrace) Constructs a CloseableReference (wrapping a SharedReference) of T with provided ResourceReleaser and a custom handler that's run if a leak is detected in the finalizer. | | static <T extends Closeable> CloseableReference<T> | of(T t, CloseableReference.LeakHandler leakHandler) Constructs a CloseableReference with a custom CloseableReference.LeakHandler that's run if a reference is not closed when the finalizer is called. | | static void | setDisableCloseableReferencesForBitmaps(int bitmapCloseableRefType) | | static boolean | useGc() |

| | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface java.io.Closeable

| abstract void | close() |

| | From interface java.lang.AutoCloseable

| abstract void | close() |

|

Public Methods

public CloseableReference<T> clone()

Returns a new CloseableReference to the same underlying SharedReference. The SharedReference ref-count is incremented.

public void close()

Closes this CloseableReference.

Decrements the reference count of the underlying object. If it is zero, the object will be released.

This method is idempotent. Calling it multiple times on the same instance has no effect.

Protected Methods

protected void finalize()

Throws

| Throwable | |

+Generated by Doclava. +