I have several classes that handle queues, with similar methods. I would like to move the injection part, to the parent class. But in every attempt that I have done, the injected values are always null.
This is one of my child classes:
import javax.inject.Inject;
import javax.ejb.MessageDriven;
@MessageDriven(name = "QueueMDB1")
public class Queue1 extends CommonQueue implements MessageListener {
@Inject
private IDao dao;
[...]
}
I would like to move dao from classes Queue1,2,3... to the parent class CommonQueue. Which annotation the parent class should have to allow the injection (if it's possible to do that)?