Ahh thanks. That's a good hint =) Kind regards!
-----Ursprüngliche Nachricht----- Von: sam lee [mailto:[email protected]] Gesendet: Montag, 16. Mai 2011 13:23 An: [email protected] Betreff: Re: Sling, OSGi bundle and annotations @Component(metatype=true) On Mon, May 16, 2011 at 7:21 AM, Marco Dohnke <[email protected]>wrote: > Hi there, > > Is there any documentation reference where I can find a description how to > build an configurable (Felix mgmt console) OSGi bundle? > In an earlier version of Sling I was able to do something like that > (anonymous): > > /** > * > * > * @scr.component immediate="true" label="MyConnector" > * description="Connector configuration" name="ConnectorImpl" > * @scr.property name="service.vendor" value="My company" > * @scr.property name="service.description" value="MyConnector" > * @scr.property name="service.pid" value="my.company.ConnectorImpl" > * @scr.service > * > */ > > public class ConnectorImpl { > > .... > > /** @scr.property */ > public static final String MY_USERNAME = "myconnector.service.username"; > > protected void activate(ComponentContext context) { > Dictionary config = context.getProperties(); > username = (String) config.get(MY_USERNAME); > } > > ... > // use the property somehow > ... > } > > The current documentation of CQ5/Sling uses annotations like @Service, > @Component and so on. I am not able to get it working with these > annotations. > > Any hints? > > Thanks in advance, > Kind regards, > Marco >
