Table of Contents | ||
---|---|---|
|
The Apache Felix Service Component Runtime described by the OSGi Desclarative Services Specification is implemented by the org.apache.felix.scr
bundle. As specified, the components must be declared in XML-formatted descriptor files which in turn must be listed in the Service-Component
header of the declaring bundle.
...
Note, that you may refer to the log
field in the activate
method as we declared the reference as required. In this case the reference is provided to the component in the bind
method before the activate
method is called.
Maven SCR Plugin
To simplify the tasks of generating the SCR Desriptor and adding the Service-Component
header to the bundle manifest, the Maven SCR Plugin may be used. This helps keeping the descriptor and the code in sync especially during development.
Summary
This tutorial just listed some very basic information on Declarative Service. To get more information, for example on hoe the Configuration Admin Service may be used to configure components, refer to the Declarative Services Sepecification in the OSGi Service Platform Service Compendium book.
...