to sort out the obvious:
- if Frobnicator is a local EJB, you could skip the production process and use / inject it directly
- if Frobnicator is a remote EJB, you should provide the link to the relevant archive (from the example: @Produces @EJB(ejbLink="../their.jar#PaymentService")
is that of any help?
Yes, that is of help. I was not aware from the reference documentation (I'm sure it's in there somewhere) that one could skip the production process entirely (not so obvious after all). Indeed that works!
I was not aware that one could skip the production process
that's an import part of the concept. CDI is a stateful implementation of the dependency injection pattern - this means, that the CDI-container managers not only the dependencies but also the lifecycle of the managed beans.
What you're usually doing is declare the dependencies and let the container do the rest. CDI will instantiate all beans in the correct scope for you. Producer methods are for (rare) cases when you need more control about that process, like maybe joining a transaction or not.
These parts of the documentation give a good overview: