@Target(value={TYPE,FIELD}) @Retention(value=CLASS) @Documented @Deprecated public @interface Reference
Reference
annotation defines references to other services
made available to the component by the Service Component Runtime.
This annotation may be declared for a Java Class or any Java Field to which it might apply. Depending on where the annotation is declared, the parameters may have different default values.
This annotation is used to declare <reference> elements of the component declaration. See section 112.4.7, Reference Element, in the OSGi Service Platform Service Compendium Specification for more information.
Modifier and Type | Optional Element and Description |
---|---|
String |
bind
Deprecated.
The name of the method to be called when the service is to be bound to
the component.
|
ReferenceCardinality |
cardinality
Deprecated.
The cardinality of the service reference.
|
String |
name
Deprecated.
The local name of the reference.
|
ReferencePolicy |
policy
Deprecated.
The dynamicity policy of the reference.
|
ReferencePolicyOption |
policyOption
Deprecated.
The policy option for the reference
|
Class<?> |
referenceInterface
Deprecated.
The name of the service interface.
|
ReferenceStrategy |
strategy
Deprecated.
The reference strategy for the reference.
|
String |
target
Deprecated.
A service target filter to select specific services to be made available.
|
String |
unbind
Deprecated.
The name of the method to be called when the service is to be unbound
from the component.
|
String |
updated
Deprecated.
The name of the method to be called when the bound service updates its
service registration properties.
|
public abstract String name
public abstract Class<?> referenceInterface
public abstract ReferenceCardinality cardinality
public abstract ReferencePolicy policy
public abstract ReferencePolicyOption policyOption
public abstract String target
public abstract String bind
public
or protected
and take single argument
which is declared with the service interface type.public abstract String unbind
public
or protected
and take single argument
which is declared with the service interface type.public abstract String updated
public abstract ReferenceStrategy strategy
ReferenceStrategy.EVENT
in which case the bind and unbind
methods are used or it can be ReferenceStrategy.LOOKUP
in which case the reference is looked up through the
component context.Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.