Module io.helidon.service.registry
Package io.helidon.service.registry
Annotation Interface Service.PreDestroy
- Enclosing class:
Service
A method annotated with this annotation will be invoked when the service registry shuts down.
Behavior of this annotation may differ based on the service registry implementation used. For example when using Helidon Service Inject (to be introduced), a pre-destroy method would be used when the scope a service is created in is finished. The core service registry behaves similar like a singleton scope - instance is created once, and pre-destroy is called when the registry is shut down. This also implies that instances that are NOT created within a scope cannot have their pre-destroy methods invoked, as we do not control their lifecycle.
The method must not have any parameters and must be accessible (not private
).