@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
>

Reply via email to