All,
I have opened a while ago -
https://issues.jboss.org/browse/CDI-457 which
was originally to add a disposable interface. The main driver was that if
you're using an injection point like
@Inject
private Instance<MyDependentBean> beanInst;
doing beanInst.get() can cause leaking beans since there is no creational
context. Upon looking at it further, there's some effort to do this in a
safer way and leverage things like TransientReference.
This doesn't work for classes provided by external libraries, even the JDK
itself (like String). I'd like to propose that the scope of this ticket be
to allow TransientReference on producer fields/methods since right now its
only allowed on types.
WDYT?
John