This content has been marked as final.
Show 2 replies
-
1. Re: ServiceLocator (or manual creation at least) and managed beans
psychollek Jul 22, 2010 7:46 AM (in response to psychollek)Maybe I'll precise :
Let assume I have :
public interface MyInterface {
void myMethod();
}
public class MyImpl1 implements MyInterface {
@EJB
MyEjbRemote ejb;void myMethod(){
ejb.doMethod1();
}}
public class MyImpl2 implements MyInterface {
@EJB
MyEjbRemote ejb;void myMethod(){
ejb.doMethod2();
}}
what I want is to get is :
List<MyInterface> implementations;
such, that both MyImpl2 and MyImpl1 are present within and both of them have MyEjbRemote ejb injected.
-
2. Re: ServiceLocator (or manual creation at least) and managed beans
pmuir Jul 27, 2010 7:56 AM (in response to psychollek)You can do
@Inject Instance<MyInterface> myInterfaces; ... for (MyInterface myInterface : myIntefaces) {