Choose EJB to be injected without recompiling
问题 Imagine you have two implementations of a @Local interface @Local public interface LocalInterface { } @Stateless public class MyFirstImplementation implements LocalInterface { } @Stateless public class MySecondImplementation implements LocalInterface { } And I want to choose, without recompiling the project (that is, at runtime or using an external configuration property) which one (MyFirstImplementation or MySecondImplementation) I want to use. public class MyClass { @EJB LocalInterface