Each one should be processed. The DS spec (112.4.1) suggests DS impls use 
Bundle.findEntries to locate the component description files names by the 
Service-Component header. Bundle.findEntries will return entries for the 
same entry name if it exists in the host and its attached fragments.

-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargr...@us.ibm.com

office: +1 386 848 1781
mobile: +1 386 848 3788





From:   Carl Hall <c...@hallwaytech.com>
To:     OSGi Developer Mail List <osgi-dev@mail.osgi.org>, 
Date:   2012/01/27 10:37
Subject:        Re: [osgi-dev] Services from a Fragment Bundle
Sent by:        osgi-dev-boun...@mail.osgi.org



If more than 1 fragment attaches to a host bundle and each of those 
fragments has a service components file (defined in host but lives in 
fragment), will each fragment's service components file be processed?

On Mon, Jan 23, 2012 at 11:24 AM, BJ Hargrave <hargr...@us.ibm.com> wrote:
This is expected behavior. DS must ignore a Service-Component header in a 
fragment, but must process any component description XML named by the 
host's Service-Component header even if those XML files come from 
fragments. 

-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargr...@us.ibm.com 

office: +1 386 848 1781
mobile: +1 386 848 3788






From:        Carl Hall <c...@hallwaytech.com> 
To:        osgi-dev@mail.osgi.org, 
Date:        2012/01/23 11:01 
Subject:        [osgi-dev] Services from a Fragment Bundle 
Sent by:        osgi-dev-boun...@mail.osgi.org 




I have an interesting scenario that I would love some clarity on. I see 
components avaiilable from a fragment bundle and I'm wondering if 
declarative services is to blame/reward. 

A third party library I use has the following setup: a host bundle with 
core-serviceComponents.xml and a fragment bundle with 
serviceComponents.xml. The fragment bundle has no Service-Component 
manifest entry while the host bundle defines the following entry: 

Service-Component: 
OSGI-INF/core-serviceComponents.xml,OSGI-INF/serviceComponents.xml 


When the host and fragment bundles are loaded into Felix, I am able to get 
a reference to services defined in the fragment bundle. Since the spec 
says that services can't be registered from a fragment bundle since a 
fragment bundle has no activation lifecycle, am I seeing these components 
because declarative services is picking up core-serviceComponents.xml 
(expected) and serviceComponents.xml (unexpected)? Is this behavior 
expected and/or defined? 

Thanks, 
Carl 
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev 

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to