Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top