@Retention(value=CLASS) @Target(value=METHOD) public @interface Reference
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.
Modifier and Type | Optional Element and Description |
---|---|
ReferenceCardinality |
cardinality
The cardinality of the reference.
|
String |
name
The name of this reference.
|
ReferencePolicy |
policy
The policy for the reference.
|
Class<?> |
service
The type of the service to bind to this reference.
|
String |
target
The target filter for the reference.
|
String |
unbind
The name of the unbind method which pairs with the annotated bind method.
|
public abstract 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 set
or
add
, that is removed.
public abstract 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 String target
public abstract 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
set
, that is replaced with unset
to derive the unbind
method name. If the annotated method name begins with add
, that
is replaced with remove
to derive the unbind method name.
Otherwise, un
is prefixed to the annotated method name to derive
the unbind method name.
Copyright © 2013 aQute SARL. All rights reserved.