Package io.avaje.inject
Annotation Type PreDestroy
-
@Documented @Retention(RUNTIME) @Target(METHOD) public @interface PreDestroy
ThePreDestroyannotation is used on a method as a callback notification to signal that the instance is in the process of being removed by the container.Note that we can equally use any
PreDestroyannotation - so we can use the one fromjavax.annotation,jakarta.annotationor this one.The method annotated with
PreDestroyis typically used to release resources that it has been holding.The method on which the
PreDestroyannotation is applied must fulfill the following criteria:- The method must not have any parameters.
- The method may be public, protected or package private.
- The method must not be static.