This content has been marked as final.
Show 1 reply
-
1. Re: Is it legal for an Extension to keep a reference to BeanManager?
mkouba Jan 31, 2018 5:48 PM (in response to ljnelson)Hi Laird,
I think it's ok to keep a reference to a
BeanManager
in an extension instance. However, beware of static fields - such aBeanManager
instance could potentially survive the shutdown of a container it comes from. And in such case, it should become unusable as its state should be cleaned up. If you only use one container at the same time thenWeldContainer.current().getBeanManager()
is probably the most efficient way to obtain a BeanManager.