I wonder, if I can inject a list of (stateless) beans, that all implementing a special interface.
For example I've a module contract
public interface ResetService {
void reset(MyContext context);
}
Than I've two modules, that are implementing this interface. And one module, that should call all implementations:
@EJBs
private List<ResetService> resetServices;
void resetAllModules(MyContext context) {
for (ResetService resetService : resetServices)
resetService.reset(context);
}
It's important that all calls are in the main transaction and the reset caller must be know, if the reset call is complete. So I can't use JMS and topics.
I think, it's not possible, or?