Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) OSGi Alliance (2011). All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.osgi.service.component.annotations;
 
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 names.

Version:
$Id: db97a1a46abf7de7ad8c0fe4f36a38d3782dd58c $
See also:
"The reference element of a Component Description."
 
 public @interface Reference {
The name of this reference.

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.

See also:
"The name attribute of the reference element of a Component Description."
 
 	String name() default "";

The type of the service to bind to this reference.

If not specified, the type of the service to bind is based upon the type of the first argument of the method being annotated.

See also:
"The interface attribute of the reference element of a Component Description."
 
 	Class< ? > service() default Object.class;

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."
 
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."
 
The target filter for the reference.

See also:
"The target attribute of the reference element of a Component Description."
 
 	String target() default "";

The name of the unbind method which is associated with the annotated bind method.

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.

See also:
"The unbind attribute of the reference element of a Component Description."
	String unbind() default "";

The policy option for the reference.

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

Since:
1.2
See also:
"The policy-option attribute of the reference element of a Component Description."
The name of the updated method which is associated with the annotated bind method.

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.

Since:
1.2
See also:
"The updated attribute of the reference element of a Component Description."
	String updated() default "";
New to GrepCode? Check out our FAQ X