Hi,
It is a simple question (however I'm not sure about the answer). In my application there is a stateful bean which works as a "work dispatcher" service - it receives events (on some scheduled time) and invokes stateless beans method passing appropriate arguments - those stateless beans do the whole job. My question is: how to obtain references to stateless beans (workers) in work dispatcher (executive) in a way that guarantee that stateless beans will be pooled (their state and number are managed by server, it is not just a single instance)?
I know, that if I obtain a reference by JNDI to the bean, then I've got proxy object, but behind it, actually might be 10 stateless beans doing its work.
But what if I am on the same virtual machine? Should I use @EJB annotation or maybe ordinary constructor?
Thanks in advance,
Piotr