@Beta
@Documented
@Target(value={FIELD,PARAMETER,METHOD})
@Retention(value=RUNTIME)
@Qualifier
@Deprecated
public @interface ForReleasableReferences
Qualifier to inject a ReleasableReferenceManager or TypedReleasableReferenceManager object for a particular scope.
For example:
@Documented
@Retention(RUNTIME)
@CanReleaseReferences
@Scope
public @interface MyScope {}
@CanReleaseReferences
public @interface MyMetadata {
int value();
}
@Documented
@Retention(RUNTIME)
@MyMetadata(15)
@Scope
public @interface YourScope {}
class MyClass {
@Inject
MyClass(
@ForReleasableReferences(MyScope.class)
ReleasableReferenceManager myScopeReferenceManager,
@ForReleasableReferences(YourScope.class)
TypedReleasableReferenceManager<MyMetadata> yourScopeReferenceManager) {
// …
}
}
Note:Releasable references uses Java's WeakReference, and so is
not compatible with GWT.
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.Class<? extends java.lang.annotation.Annotation> |
value
Deprecated.
The reference-releasing scope annotation type.
|
public abstract java.lang.Class<? extends java.lang.annotation.Annotation> value