org.osgi.service.component.annotations
Annotation Type LookupReference


@Retention(value=CLASS)
@Target(value={})
public @interface LookupReference

Define a lookup strategy reference for a Component.

The referenced service can be accessed using one of the locateService methods of ComponentContext.

This annotation is not processed at runtime by a Service Component Runtime implementation. It must be processed by tools and used to add a Component Description to the bundle.

In the generated Component Description for a component, the references must be ordered in ascending lexicographical order (using String.compareTo ) of the reference names.

Since:
1.3
Author:
$Id: 39a18d2d533af21bee40e41d09b8d5a8405e100b $
See Also:
"The reference element of a Component Description."

Required Element Summary
 String name
          The name of this reference.
 Class<?> service
          The type of the service to bind to this reference.
 
Optional Element Summary
 ReferenceCardinality cardinality
          The cardinality of the reference.
 ReferencePolicy policy
          The policy for the reference.
 ReferencePolicyOption policyOption
          The policy option for the reference.
 ReferenceScope scope
          The requested service scope for this Reference.
 String target
          The target filter for the reference.
 

Element Detail

name

public abstract String name
The name of this reference.

See Also:
"The name attribute of the reference element of a Component Description."

service

public abstract Class<?> service
The type of the service to bind to this reference.

See Also:
"The interface attribute of the reference element of a Component Description."

cardinality

public abstract ReferenceCardinality cardinality
The cardinality of the reference.

If not specified, the reference has a 1..1 cardinality.

See Also:
"The cardinality attribute of the reference element of a Component Description."
Default:
org.osgi.service.component.annotations.ReferenceCardinality.MANDATORY

policy

public abstract ReferencePolicy policy
The policy for the reference.

If not specified, the STATIC reference policy is used.

See Also:
"The policy attribute of the reference element of a Component Description."
Default:
org.osgi.service.component.annotations.ReferencePolicy.STATIC

target

public abstract String target
The target filter for the reference.

See Also:
"The target attribute of the reference element of a Component Description."
Default:
""

policyOption

public abstract ReferencePolicyOption policyOption
The policy option for the reference.

If not specified, the RELUCTANT reference policy option is used.

See Also:
"The policy-option attribute of the reference element of a Component Description."
Default:
org.osgi.service.component.annotations.ReferencePolicyOption.RELUCTANT

scope

public abstract ReferenceScope scope
The requested service scope for this Reference.

If not specified, the bundle service scope is requested.

See Also:
"The scope attribute of the reference element of a Component Description."
Default:
org.osgi.service.component.annotations.ReferenceScope.BUNDLE


Copyright © 2014 aQute SARL. All rights reserved.