JAVA OSGI架构BluPrint容器的三大管理器组件

来源:互联网 发布:网络乌托邦 编辑:程序博客网 时间:2024/05/17 02:50

一、Bean 组件管理器

用过Hibernate 的童鞋应该知道这个原理,废话不多说看看代码就知道。

<bean id="bpImpl01" class="com.reference.impl.cn.ReferenceImpl">

    <property name="bp01" ref="bpInterface01"/>

    <property.........n>

  </bean>

这里是一个具体的实现   它可以同时引用多个服务接口,不多说看了就会明白

二、Sercice组件管理器

这里申明一个服务的引用,并在程序一开始应用时加载该服务,该组件还有多个可选属性具体的多看看文档就应该知道了

<service id="bpInterface" ref="bpImpl01" interface="com.buleprint.interfaces.cn.BuleprintInterfaceTwo"  activation="eager"/>

三、Service Reference 组件管理器

不多解释    这是一个引用了服务的组件管理器     至于后面的两个属性就不一一解释了    

 <reference id="bpInterface01"  interface="com.buleprint.interfaces.cn.BuleprintInterfaceOne" availability="mandatory" activation="eager"/>


       



原创粉丝点击