Hmm, do we need it? Hit that yesterday in Se part but just think services shouldn't be allowed to access the WBC until it is registered. Being all lazy works, we just need to loose our bad habit to use WBC.currentInstance() ;)
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://blog-rmannibucau.rhcloud.com> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2017-06-02 10:00 GMT+02:00 Mark Struberg <[email protected]>: > Hi! > > While figuring out yet another timing glitch with AnnotationManager and > NoticationManager I thought about introducing a LifecycleAware Interface in > our SPI. > > public interface LifecycleAware { > > enum LifecyclePhase { > NEW, // first status when a Service got ct-ed > INITIALIZED, // WebBeansContext initialized > BOOTED, // After firing AfterDeploymentValidation > SHUTTING_DOWN // before firing BeforeShutdown > } > void enterPhase(LifecyclePhase phase); > } > > In WebBeansContext we iterate over all Services and call enterPhase on all > Svc which implement LifecycleAware. > > wdyt? > > LieGrue, > strub > >
