M
- the type of the metadata annotation@Beta @Deprecated public interface TypedReleasableReferenceManager<M extends java.lang.annotation.Annotation> extends ReleasableReferenceManager
ReleasableReferenceManager
for a scope that is annotated with an annotation that itself
is annotated with CanReleaseReferences
. That annotation is available as metadata()
and may be useful at runtime to decide when to release references held by the scope.
For example:
@CanReleaseReferences public @interface SomeAnnotation { int value(); } @Documented @Retention(RUNTIME) @SomeAnnotation(15) @Scope public @interface MyScope {} // In a component that is (or has a subcomponent) annotated with @MyScope: @Inject void manager( @ForReferenceReleasingScope(MyScope.class) TypedReferenceReleasingScope<SomeAnnotation> manager) { manager.metadata().value(); // returns 15 }
This interface is implemented by Dagger.
Modifier and Type | Method and Description |
---|---|
M |
metadata()
Deprecated.
Returns the annotation on
ReleasableReferenceManager.scope() that is annotated with CanReleaseReferences . |
releaseStrongReferences, restoreStrongReferences, scope
M metadata()
ReleasableReferenceManager.scope()
that is annotated with CanReleaseReferences
.