Hello,
I want to inject a POJO into an EJB3 Stateless Session Bean with Spring 2.0.8 (I have to stick with this version because of JDO 1.0 compatibility).
I have found some resources on the net but no complete example, so I'm missing the big picture. Basically I have a Service-Interface "Service". This interface is implemented by the "ServiceImpl"-Pojo and the EJB. The EJB is called by a Java client and delegates all service calls to the service implementation. I understand, that I should use the Configurable annotation to inject the "ServiceImpl" - POJO into my EJB, so my classes look like this:
Service:
ServiceImpl:Code:public interface Service { public String sayHello(); }
ServiceEJB:Code:public class ServiceImpl implements Service { public String sayHello() { return "Hello World!"; } }
I guess that the Configurable annotation causes Spring to instantiate a bean-factory in the background, but what I do not understand is where it is looking for the configuration file?Code:Configurable Stateless Remote(Service.class) public class ServiceEJB implements Service { private Service service; public String sayHello() { service.sayHello(); } }
So I'm a bit confused how these components are "glued" together and what effects the Configurable annotation really has.
I hope that someone can help me.
Thank's in advance!


Reply With Quote