jakartaee / rest

Jakarta RESTful Web Services
Other
361 stars 116 forks source link

Livecycle events: Shutdown hooks #566

Open glassfishrobot opened 7 years ago

glassfishrobot commented 7 years ago

Some applications, particularly such dealing with native access like in the world of IoT, need to know when the application is shutdown.

For example, a JAX-RS Feature "Native Hardware Access" is used to access a proprietary encryption device. Some devices cannot be used by multiple applications, so need to be locked and unlocked. A different use case could be the need to close open handles or flush caches etc.

While a feature already has a startup event (configure method), it has no shutdown event. Hence I would like to suggest to supply configurables with a shutdown default method, which by default does nothing, but which could be overwritten by application developers.

glassfishrobot commented 6 years ago