Versions Compared

Key

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

...

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

ds

true

no

Whether Declarative Services descriptor is generated or not. If this parameter is not set or set to true the Declarative Services descriptor is generated in the service descriptor file for this component. Otherwise no Declarative Services descriptor is generated for this component.

specVersion

1.0

no

Defines what Declarative Services specification the component is written against. Though the Maven SCR Plugin is very good at detecting whether components are written against the original or a newer specification, there are some cases, where the plugin may fail. For these cases, the specVersion attribute may be set to the correct version. Currently supported values for this attribute are 1.0 and 1.1. Since version 1.4.1 of the Maven SCR Plugin and version 1.0.1 of the SCR Annotations.

componentAbstract

see description

no

This marks an abstract service description which is not added to the descriptor but intended for reuse through inheritance. This attribute defaults to true for abstract classes and false for concrete classes.

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

no

component.immediate

Whether the component is immediately activated

inherit

true

no

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

metatype

false

no

Whether Metatype Service data is generated or not. If this parameter is 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.

createPid

true

no

service.pid

Generate the service.pid property if non is declared.

configurationFactory

false

no

Designate.factoryPid

Is this a configuration factory? (since 1.4.0)

...

policy

OPTIONAL

no

component.policy

The configuration policy for this component: OPTIONAL, IGNORE, or REQUIRE

...

Name

Default Value

Required

SCR

Metatype

Description

name

The name of constant

yes

property.name

AD.id

The name of the property. If this tag is defined on a field with an initialization expression, the value of that expression is used as the name if the field is of type String.

value

no

property.value

AD.default

The string value of the property. This can either be a single value or an array.

longValue

no

property.value

AD.default

The long value of the property. This can either be a single value or an array.

doubleValue

no

property.value

AD.default

The double value of the property. This can either be a single value or an array.

floatValue

no

property.value

AD.default

The float value of the property. This can either be a single value or an array.

intValue

no

property.value

AD.default

The int value of the property. This can either be a single value or an array.

byteValue

no

property.value

AD.default

The byte value of the property. This can either be a single value or an array.

charValue

no

property.value

AD.default

The char value of the property. This can either be a single value or an array.

boolValue

no

property.value

AD.default

The boolean value of the property. This can either be a single value or an array.

shortValue

no

property.value

AD.default

The short value of the property. This can either be a single value or an array.

label

%<name>.name

no

AD.name

The label to display in a form to configure this property. This name may be localized by prepending a % sign to the name.

description

%<name>.description

no

AD.description

A descriptive text to provide the client in a form to configure this property. This name may be localized by prepending a % sign to the name.

propertyPrivate

Depending on the name

no

See description

Boolean flag defining whether a metatype descriptor entry should be generated for this property or not. By default a metatype descriptor entry, i.e. an AD element, is generated except for the properties service.pid, service.description, service.id, service.ranking, service.vendor, service.bundlelocation and service.factoryPid. If a property should not be available for display in a configuration user interface, this parameter should be set to true.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ab75d2a6f9b22c36-5dae0d46-44eb4436-aa17ada5-a283ee070152caa31a622080"><ac:plain-text-body><![CDATA[

cardinality

Depends on property value(s)

no

AD.cardinality

Defines the cardinality of the property and its collection type. If the cardinality is negative, the property is expected to be stored in a java.util.Vector (primitive types such as boolean are boxed in the Wrapper class), if the cardinality is positive, the property is stored in an array (primitve types are unboxed, that is Boolean type values are stored in boolean[]). The actual value defines the maximum number of elements in the vector or array, where Integer.MIN_INT describes an unbounded Vector and Integer.MAX_INT describes an unbounded array. If the cardinality is zero, the property is a scalar value. If the defined value of the property is set in the value attribute, the cardinality defaults to 0 (zero for scalar value). If the property is defined in one or more properties starting with values, the cardinality defaults to Integer.MAX_INT, that is an unbounded array.

]]></ac:plain-text-body></ac:structured-macro>

options

no

See below

See below for a description of the options attribute.

...

Name

Default Value

Required

Descriptor

Description

name

Name of the field

yes

reference.name

The local name of the reference. If the Reference annotation is declared in the class comment, this parameter is required. If the annotation is declared on a field, the default value for the name parameter is the name of the field

interface

Type of the field

yes

reference.interface

The name of the service interface. This name is used by the Service Component Runtime to access the service on behalf of the component. If the Reference annotation is declared on a class level, this parameter is required. If the annoation is declared on a field, the default value for the interface parameter is the type of the field

cardinality

1..1

no

reference.cardinality

The cardinality of the service reference. This must be one of value from the enumeration ReferenceCardinality

policy

static

no

reference.policy

The dynamicity policy of the reference. If dynamic the service will be made available to the component as it comes and goes. If static the component will be deactivated and re-activated if the service comes and/or goes away. This must be one of static and dynamic

target

no

reference.target

A service target filter to select specific services to be made available. In order to be able to overwrite the value of this value by a configuration property, this parameter must be declared. If the parameter is not declared, the respective declaration attribute will not be generated

bind

See description

no

reference.bind

The name of the method to be called when the service is to be bound to the component. The default value is the name created by appending the reference name to the string bind. The method must be declared public or protected and take single argument which is declared with the service interface type

unbind

See description

no

reference.unbind

The name of the method to be called when the service is to be unbound from the component. The default value is the name created by appending the reference name to the string unbind. The method must be declared public or protected and take single argument which is declared with the service interface type

strategy

event

no

reference.strategy

The strategy used for this reference, one of event or lookup

...

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

ds

true

no

Whether Declarative Services descriptor is generated or not. If this parameter is not set or set to true the Declarative Services descriptor is generated in the service descriptor file for this component. Otherwise no Declarative Services descriptor is generated for this component.

abstract

see description

no

This marks an abstract service description which is not added to the descriptor but intended for reuse through inheritance. This attribute defaults to true for abstract classes and false for concrete classes.

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

no

component.immediate

Whether the component is immediately activated

inherit

true

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.

create-pid

true

no

service.pid

Generate the service.pid property if non is declared.

configurationFactory

false

no

Designate.factoryPid

Is this a configuration factory? (since 1.4.0)

...

policy

OPTIONAL

no

component.policy

The configuration policy for this component: OPTIONAL, IGNORE, or REQUIRE

activate

activate

no

component.activate

The name of the component activation method.

deactivate

deactivate

no

component.deactivate

The name of the component deactivation method.

modified

no

component.modified

The name of the component modified method.

...

Name

Default Value

Required

SCR

Metatype

Description

name

The name of constant

yes

property.name

AD.id

The name of the property. If this tag is defined on a field with an initialization expression, the value of that expression is used as the name if the field is of type String.

value

no

property.value

AD.default

The value of the property. If the property type is not String, parsing of the value is done using the valueOf(String) method of the class defined by the property type

type

String

no

property.type

AD.type

The type of the property value. This must be one of String, Long, Double, Float, Integer, Byte, Char, Boolean and Short.

label

%<name>.name

no

AD.name

The label to display in a form to configure this property. This name may be localized by prepending a % sign to the name.

description

%<name>.description

no

AD.description

A descriptive text to provide the client in a form to configure this property. This name may be localized by prepending a % sign to the name.

private

Depending on the name

no

See description

Boolean flag defining whether a metatype descriptor entry should be generated for this property or not. By default a metatype descriptor entry, i.e. an AD element, is generated except for the properties service.pid, service.description, service.id, service.ranking, service.vendor, service.bundlelocation and service.factoryPid. If a property should not be available for display in a configuration user interface, this parameter should be set to true.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="42378f4d7dc549ba-71db0518-48b44774-86f29345-e1c0baea93f5b7b1a9bc3afd"><ac:plain-text-body><![CDATA[

cardinality

Depends on property value(s)

no

AD.cardinality

Defines the cardinality of the property and its collection type. If the cardinality is negative, the property is expected to be stored in a java.util.Vector (primitive types such as boolean are boxed in the Wrapper class), if the cardinality is positive, the property is stored in an array (primitve types are unboxed, that is Boolean type values are stored in boolean[]). The actual value defines the maximum number of elements in the vector or array, where Integer.MIN_INT describes an unbounded Vector and Integer.MAX_INT describes an unbounded array. If the cardinality is zero, the property is a scalar value. If the defined value of the property is set in the value attribute, the cardinality defaults to 0 (zero for scalar value). If the property is defined in one or more properties starting with values, the cardinality defaults to Integer.MAX_INT, that is an unbounded array.

]]></ac:plain-text-body></ac:structured-macro>

options

no

See below

See below for a description of the options parameter.

values*

no

See below

See below for a description of parameters starting with values.

valueRef

no

AD.default

A constant containing the value for this property. The constant can either be declared in the same class as this property or in any class that is imported. The type of the property is derived from the constant.

valueRefs

no

See below

Same as the values attribute with the difference that it acts like the valueRef attribute and the value points to a constants defining the multi value for the property.

...

Name

Default Value

Required

Descriptor

Description

name

Name of the field

yes

reference.name

The local name of the reference. If the scr.reference tag is declared in the class comment, this parameter is required. If the tag is declared in the field comment, the default value for the name parameter is the name of the field

interface

Type of the field

yes

reference.interface

The name of the service interface. This name is used by the Service Component Runtime to access the service on behalf of the component. If the scr.reference tag is declared in the class comment, this parameter is required. If the tag is declared in the field comment, the default value for the interface parameter is the type of the field

cardinality

1..1

no

reference.cardinality

The cardinality of the service reference. This must be one of 0..1, 1..1, 0..n, and 1..n

policy

static

no

reference.policy

The dynamicity policy of the reference. If dynamic the service will be made available to the component as it comes and goes. If static the component will be deactivated and re-activated if the service comes and/or goes away. This must be one of static and dynamic

target

no

reference.target

A service target filter to select specific services to be made available. In order to be able to overwrite the value of this value by a configuration property, this parameter must be declared. If the parameter is not declared, the respective declaration attribute will not be generated

bind

See description

no

reference.bind

The name of the method to be called when the service is to be bound to the component. The default value is the name created by appending the reference name to the string bind. The method must be declared public or protected and take single argument which is declared with the service interface type

unbind

See description

no

reference.unbind

The name of the method to be called when the service is to be unbound from the component. The default value is the name created by appending the reference name to the string unbind. The method must be declared public or protected and take single argument which is declared with the service interface type

strategy

event

no

reference.strategy

The strategy used for this reference, one of event or lookup

...