org.apache.felix.ipojo.annotations

## Annotation Type Provides

    @Target(value={TYPE,ANNOTATION_TYPE})
    public @interface Provides

This annotation declares that the component instances will provide a service.

         @Component
          @Provides
         public class MyComponent implements Service {
             // ...
         }

Author:
  Felix Project Team

### Optional Element Summary

Optional Elements
`StaticServiceProperty[]` `properties` Allows adding static properties to the service.
`Class[]` `specifications` Set the provided specifications.
`String` `strategy` Set the service object creation strategy.

### Element Detail

#### specifications

    public abstract Class[] specifications

Set the provided specifications. It can be used to force the exposed service to use an implementation class (not an interface) as specification. Default : all implemented interfaces

         @Component
          @Provides(specifications = AbsComponent.class)
         public class MyComponent extends AbsComponent {
             // ...
         }

Default:
  {}

#### strategy

    public abstract String strategy

Set the service object creation strategy. Multiple values are possible: SINGLETON, SERVICE, METHOD, INSTANCE or the strategy fully qualified class name:

- SINGLETON: Default strategy
- SERVICE: OSGi Service Factory style, 1 POJO instance per consumer bundle
- METHOD: Delegates the creation to the factory-method of the component, method will be called every time the service reference is get.
- INSTANCE: Creates one service object per requiring instance
- Any other value is interpreted as the qualified name of a `CreationStrategy` implementation

Default:
  "SINGLETON"

#### properties

    public abstract StaticServiceProperty[] properties

Allows adding static properties to the service. Nested properties are static service properties, so must contain the name, value and type as they are not attached to a field (cannot discover type through introspection). The array contains `StaticServiceProperty` elements. Default : No service properties

         @Component
          @Provides(
             properties = {
                  @StaticServiceProperty(name = "size", type = "int", value = "5"),
                  @StaticServiceProperty(name = "name", type = "java.lang.String", value = "OSGi")
             }
         )
         public class MyComponent implements Service {
             // ...
         }

Default:
  {}