Package io.micronaut.context.annotation
Annotation Type InjectScope
-
@Target(PARAMETER) @Retention(RUNTIME) @Scope public @interface InjectScope
An annotation that can be declared on a constructor or method parameter that indicates that the injected bean should be destroyed after injection completes.
More specifically after a constructor or method which is annotated with
Inject
completes execution then any parameters annotated withInjectScope
which do not declare a specific scope such asSingleton
will be destroyed resulting in the execution ofPreDestroy
handlers on the bean and any dependent beans.- Since:
- 3.1.0