Following scenario
public interface MyInterface{
void doSomething();
}
@ApplicationScoped
public static class MyInterfaceImpl implements MyInterface{
@Override
public void doSomething() {
}
}
@ApplicationScoped
public static class MyInterfaceImplProxy implements MyInterface{
@Inject
MyInterface myInterface;
@Override
public void doSomething() {
myInterface.doSomething();
}
}
Of course, we now have a problem, as there are two beans available for one interface.
Is there a way to annotate the Proxy bean as such, so it won't be considered as an actual bean of type MyInterface
or is the only way to use @Named
beans here?