您的位置:首页 > 编程语言 > Java开发

Spring and Enterprise JavaBeans(Chapter 11 of Spring In Action)

2010-07-25 11:36 627 查看
  Although Spring’s POJO-based development model offers a compelling alternative to Enterprise JavaBeans, there may be factors (either technical, political, or historical) that force a project to choose EJBs. In those cases, there’s no need to dismiss Spring entirely, as Spring supports both EJB development and consumption.  Using EJB proxies, we declared references to EJBs in a Spring application context. Once configured in Spring, the EJB could then be wired into other Spring beans that will consume the EJB’s services. We also looked at how EJB proxy declaration is made simpler using Spring 2.0’s <jee:local-slsb> and <jee:remote-slsb> configuration elements.

  We then turned our attention to developing EJBs. Even though Spring doesn’t provide a mechanism for directly hosting 2.x EJBs in the Spring container, Spring

does provide a set of Spring-aware base classes from which EJBs can be developed.

  These base classes expose the Spring application context to the EJB so that the EJB can delegate its work to Spring-managed POJOs. Finally, we peeked at Pitchfork, an intriguing Spring add-on that enables the use of EJB 3 annotations for dependency injection and AOP within a Spring container.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: