aries-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <cmoulli...@gmail.com>
Subject Question about Blueprint Service and Bundle loading
Date Fri, 20 Apr 2012 11:43:55 GMT
Hi,

I would like to know if this is possible for a bundle to know based on info
defined in the OSGI Service registered in the OSGI Registry that it must
loads package by example com.mycompany.poc.service.Feedback from a bundle A
and not bundle B when its service definition contain a reference to a
specific filter ?

Bundle 1

    <service ref="service" interface="com.mycompany.poc.service.Feedback">
        <service-properties>
            <entry key="version" value="1"/>
        </service-properties>
    </service>

Bundle 2

    <service ref="service" interface="com.mycompany.poc.service.Feedback">
        <service-properties>
            <entry key="version" value="2"/>
        </service-properties>
    </service>

Bundle 3 = Client consuming service

 <bean id="helloBean" class="com.mycompany.poc.client.HelloBean">
      <property name="feedbackService">
          <reference interface="com.xtrac.poc.service.Feedback"
filter="(version=1)"/>
      </property>
  </bean>

Here is the definition of the Bundle 3 Manifest

Import-Service =
com.xtrac.poc.service.Feedback

DynamicImport-Package =
com.xtrac.poc.service

This definition tells the bundle that it has do dynamically loads classes
but in this case, the OSGI runtime will load classes from maybe Bundle A or
bundle B.

Regards,


Charles Moulliard

Apache Committer

Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard

Mime
View raw message