Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The scr goal of the maven-scr-plugin looks for the following JavaDoc tags when building component descriptors:

Anchor
scr.component
scr.component
h4. 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

component.name

OCD.id

Defines the Component name also used as the PID for the Configuration Admin Service

abstract

false

no

This marks an abstract service description which is not added to the descriptor but intended for reuse through inheritance

enabled

true

no

component.enabled

Whether the component is enabled when the bundle starts

factory

no

component.factory

Whether the component is a factory component

immediate

true

no

component.immediate

Whether the component is immediately activated

inherit

false

no

Whether any service, property and reference declarations from base classes should be inherited by this class.

metatype

true

no

Whether Metatype Service data is generated or not. If this parameter is not set or set to true Metatype Service data is generated in the metatype.xml file for this component. Otherwise no Metatype Service data is generated for this component.

label

%<name>.name

no

OCD.name

This is generally used as a title for the object described by the meta type. This name may be localized by prepending a % sign to the name.

description

%<name>.name

no

OCD.description

This is generally used as a description for the object described by the meta type. This name may be localized by prepending a % sign to the name.

Anchor
scr.property
scr.property
h4. 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
scr.service
h4. 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
scr.reference
h4. scr.reference

The scr.reference tag defines references to other services made available to the component by the Service Component Runtime. This tag

...