|
OSGi™ Enterprise Release 5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=CLASS) @Target(value=METHOD) public @interface Reference
Identify the annotated method as a bind
method of a Service
Component.
The annotated method is a bind method of the Component.
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 name
s.
Optional Element Summary | |
---|---|
ReferenceCardinality |
cardinality
The cardinality of the reference. |
java.lang.String |
name
The name of this reference. |
ReferencePolicy |
policy
The policy for the reference. |
ReferencePolicyOption |
policyOption
The policy option for the reference. |
java.lang.Class<?> |
service
The type of the service to bind to this reference. |
java.lang.String |
target
The target filter for the reference. |
java.lang.String |
unbind
The name of the unbind method which is associated with the annotated bind method. |
java.lang.String |
updated
The name of the updated method which is associated with the annotated bind method. |
public abstract java.lang.String name
If not specified, the name of this reference is based upon the name of
the method being annotated. If the method name begins with bind
,
set
or add
, that is removed.
public abstract java.lang.Class<?> service
If not specified, the type of the service to bind is based upon the type of the first argument of the method being annotated.
public abstract ReferenceCardinality cardinality
If not specified, the reference has a
1..1
cardinality.
public abstract ReferencePolicy policy
If not specified, the STATIC
reference
policy is used.
public abstract java.lang.String target
public abstract java.lang.String unbind
To declare no unbind method, the value "-"
must be used.
If not specified, the name of the unbind method is derived from the name
of the annotated bind method. If the annotated method name begins with
bind
, set
or add
, that is replaced with
unbind
, unset
or remove
, respectively, to derive
the unbind method name. Otherwise, un
is prefixed to the
annotated method name to derive the unbind method name. The unbind method
is only set if the component type contains a method with the derived
name.
public abstract ReferencePolicyOption policyOption
If not specified, the RELUCTANT
reference policy option is used.
public abstract java.lang.String updated
To declare no updated method, the value "-"
must be used.
If not specified, the name of the updated method is derived from the name
of the annotated bind method. If the annotated method name begins with
bind
, set
or add
, that is replaced with
updated
to derive the updated method name. Otherwise,
updated
is prefixed to the annotated method name to derive the
updated method name. The updated method is only set if the component type
contains a method with the derived name.
|
OSGi™ Enterprise Release 5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |