Can the OSGi snippet package publish a declarative service?

I have a snippet package that I created to access some of the add functions in the second side of the banner. My snippet needs to register a service in order to discover this new functionality. This does not seem to work. Before delving into troubleshooting, I would like to know if this is allowed? That is, the Felix SCR packet watcher is watching or ignoring fragments?

+5
source share
2 answers

Yeah, I myself found the answer in the specification, section 112.4.2: "The header of the Service-Component manifest specified in the fragment is ignored by SCR." This is consistent with 3.14.3: "The following list contains headers that should not be used in the fragment package: Bundle-Activator"

+8
source

Yes. But the host node must be open for this. When opening, I mean that the node of the node must have a header Service-Componentsconfigured in such a way that all the descriptors in the fragment are found. For instance:

Service-Components: OSGI-INF/*.xml 

will find all .xmlfiles in the OSGi-INF/host folder for all attached fragments.

I saw that the Eclipse SmartHome project uses this solution to make its interface more customizable.

: http://apache-felix.18485.x6.nabble.com/DS-amp-fragments-td5004610.html

+2

All Articles