将Spring组件导出为OSGi服务

Ale*_*nov 5 service spring osgi

是否可以自动将Spring @Component(或其中一个规范;例如@Repository)注册为OSGi服务?所以我可以在一个捆绑包和OSGi Service Registry中使用自动装配和Spring的所有其他好处来在捆绑包之间进行通信?

更新:从这个讨论来看,似乎不可能使用标准蓝图,仅在Eclipse Gemini中.

art*_*tol 5

我假设您熟悉Eclipse Gemini Blueprint(以前的Spring Dynamic Modules,以前的Spring OSGi)?

您使用<service>-tag导出bean .我不确定你是否可以@Component自动导出所有等注释的bean.

  • 和@artbristol只是喜欢OSGi :) (2认同)