users@jersey.java.net

[Jersey] HK2 Lifecycle w/Jersey 2

From: <mrandall_at_cerner.com>
Date: Thu, 23 Jan 2014 20:52:29 +0000 (UTC)

What's the correct way to ensure that HK2 PreDestroy() semantics are
properly observed in singletons bound using Jersey 2 at shutdown? Some
have suggested injecting the ServiceLocator into the application, then
invoking shutdown on it during PreDestroy().

[1]
http://stackoverflow.com/questions/19735711/jersey-2-3-not-invoking-hk2
-service-locator-shutdown-when-servlet-container-is-s