...
The scr
goal of the maven-scr-plugin
looks for the following JavaDoc tags when building component descriptors:
[#scr_componentscr.component]
[#scr_propertyscr.property]
[#scr_servicescr.service]
[#scr_referencescr.reference]
scr.reference
Anchor | ||||
---|---|---|---|---|
|
scr.component
The scr.component
tag is the only required tag. If this tag is not declared in the Java class comment, the class is not declared as a component.
...
Name | Default Value | Required | SCR | Metatype | Description |
name | Fully qualified name of the Java class | no | | | Defines the Component name also used as the PID for the Configuration Admin Service |
abstract | | no | This marks an abstract service description which is not added to the descriptor but intended for reuse through inheritance | ||
enabled | | no | | Whether the component is enabled when the bundle starts | |
factory | no | | Whether the component is a factory component | ||
immediate | | no | | Whether the component is immediately activated | |
inherit | | no | Whether any service, property and reference declarations from base classes should be inherited by this class. | ||
metatype | | no | Whether Metatype Service data is generated or not. If this parameter is not set or set to | ||
label | | no | | This is generally used as a title for the object described by the meta type. This name may be localized by prepending a | |
description | | no | | This is generally used as a description for the object described by the meta type. This name may be localized by prepending a |
Anchor | ||||
---|---|---|---|---|
|
scr.property
The scr.property
tag defines properties which are made available to the component through the ComponentContext.getProperties()
method. These tags are not strictly required but may be used by components to defined initial configuration. Additionally properties may be set here to identify the component if it is registered as a service, for example the service.description
and service.vendor
properties.
...
If the cardinality of the property is not explicilty set with the cardinality
property, it defaults to Integer.MAX_INT
, i.e. unbound array, if multiple values with a series of values
parameters are defined. Otherwise the cardinality
parameter may be set for example to a negative value to store the values in a java.util.Vector
instead.
Anchor | ||||
---|---|---|---|---|
|
scr.service
The scr.service
tag defines whether and which service interfaces are provided by the component.
...
Omitting the scr.service
tag will just define (and activate if required) the component but not register it as a service. Multiple scr.service
tags may be declared each with its own interface
. The component is registered as a ServiceFactory
if at least on scr.service
tag declares the servicefactory
parameter as true
.
Anchor | ||||
---|---|---|---|---|
|
scr.reference
The scr.reference
tag defines references to other services made available to the component by the Service Component Runtime. This tag
...