This content has been marked as final.
Show 3 replies
-
1. Re: CDI 1.1 Dispose injected resource Immediate after using
tremes Apr 18, 2016 10:16 AM (in response to vigor78)Hi,
So do you want to destroy an dependent instance immediately after it was injected in constructor right? Am I understanding it correctly? You can use javax.enterprise.inject.Instance Contexts and Dependency Injection for the Java EE platform
theoretically.
-
2. Re: CDI 1.1 Dispose injected resource Immediate after using
mkouba Apr 18, 2016 10:27 AM (in response to vigor78)Hi Igor,
you could make use of
@javax.enterprise.inject.TransientReference
. The producer method for SimpleResource is@Dependent
so the disposer method should be called when the invocation of the constructor completes. -
3. Re: CDI 1.1 Dispose injected resource Immediate after using
vigor78 Apr 19, 2016 4:19 AM (in response to mkouba)Thank you very much. It is very ellegant solution