[cdi-dev] Shutting down CDI Instances
John D. Ament
john.d.ament at gmail.com
Tue Mar 24 14:00:00 EDT 2015
In discussion today w/ Jozef, we found that the way of shutting down a
container in the proposed SE API precluded the notion that multiple
containers could be running. While we're not necessarily going to handle
multiple containers right now, we don't want to preclude the idea either.
With that said, there were three different approaches though up to handle
how to shutdown a launched container. it obivously would only work with an
SE booted container, but part of this does give a pointer in how we may
Option 1 - Subclass CDI. The returned CDI instance when bootstrapped would
return this subclass of CDI that has shutdown capability.
Option 2 - Add method to CDI. Add the shutdown method to CDI directly, and
throw an exception if called in an EE environment.
Option 3 - Return a different object all together when initializing.
Return something else from initialize, e.g. CDIContext, which has a
shutdown method when you initialize. That class would also have a getter
for the CDI instance backing it.
Let us know your thoughts.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cdi-dev