@Resource annotation appeared for the first time in Java EE 5 specification.
When you annotate an attribute with
@Resource, it will be the container
responsible of injecting the requested resource. […] With Apache TomEE you can do it
by providing your own
@Resource provider class. In this post we are going to see how
you write your own provider for MongoDB so you can use
Code seems to be pretty simple. But it doesn’t go into details like lifecycle & such, which usually makes these things much more interesting.
Original title and link: Writing your own @Resource: Apache TomEE + NoSQL