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 local;
}
Once one implementation is chosen, it does not have to change. I am using JBoss 5.1 if that helps.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…