I have some possible trivial questions.
If I defined an EJB3 + interface, let's say that it is removed like this:
@Remote public class FooServiceRemote { void foo(); }
and one implementation
@Stateless public class FooService implements FooServiceRemote { void foo() { ... } }
How does the application server by default allow which implementation to use (and call through a proxy) if it knows only the @EJB annotation for dependency injection, for example, through the interface:
public class SomeClass { @EJB private FooServiceRemote fooService; }
Is this done by reflection (shortening the interface name)? Or he scans for possible implementations of such an interface, selecting it. Or..? And what if I want to create more implementations of one interface, is it possible and how to specify which implementation should be created (perhaps this is possible through some annotation argument).
Thanks: -)
source share