I have been trying to find out if this is possible but can't get an answer to it.
I have a EJB 3.0 class and its local interface.
@Local
public interface MyService {
public String foo();
}
@Stateless
public class MyServiceBean implements MyService {
@Resource(name="type") private String type;
public String foo() { return type; }
}
Now, here is the question. I want to define two EJBs with different names that use the same class so that I can inject two different "type" values (defined in ejb-jar.xml).
Then in using that in a different class, for example:
@EJB(mappedName="MyServiceBeanA")
private MyService myServiceBeanA;
@EJB(mappedName="MyServiceBeanB")
private MyService myServiceBeanB;
Thx, Daniel