4

What's the difference between "service property" and "property" at http://felix.apache.org/site/how-to-use-ipojo-annotations.html#HowtouseiPOJOAnnotations-@ServiceProperty?

Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487

1 Answers1

2

A @ServiceProperty is published with the (OSGi) services provided by the component. On the other side, @Property are kept private.

For example:

@Component
@Provides
public class MyComponent implements MyService {

    @Property
    private String hidden;

    @ServiceProperty
    private String shown;

    [...]

}

This component publishes the MyService 'service' with the 'shown' property. 'hidden' is not published.

Clement
  • 2,817
  • 1
  • 12
  • 11