Versions Compared

Key

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

...

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

Notes:

  • It is not currently possible to declare a reference without bind or unbind If you define a reference on a field and there is no bind or unbind method, the plugin will create the necessary methods.

Abstract Service Descriptions

...