1 Reply Latest reply on Jul 29, 2015 9:00 PM by Joel Pearson

    Hooking into the EJB Thread lifecycle EAP 6.2

    Joel Pearson Newbie



      I'm wondering if there is any way to hook into the EAP 6.2 EJB Thread life-cycle?


      The reason I ask is that we're trying to pool some expensive non-managed objects transparently, and I wanted to release an object in a thread local back to the pool at the end of the EJB lifecycle.


      I presume JBoss has to do this itself when a Stateless Session bean has finished being used when the request has finished, so I was wondering if it is possible to hook into.


      Otherwise is there some CDI way to pool arbitrary objects and have callback methods to prepare/clean the object before it is given to a new thread?