>>>>> Steinar Bang <[email protected]>:
>>>>> Steinar Bang <[email protected]>:

>> I'm in the process of replacing my own home brewed "mini dependency
>> injection"[1] with Declarative Services (DS).

>> I'm wondering how to replace what I was doing here:
>> https://github.com/steinarb/ukelonn/blob/b369b5768c08a1c6bb6fb422e2f462ca797c253f/ukelonn.bundle/src/main/java/no/priv/bang/ukelonn/impl/UkelonnServletProvider.java#L57

>> I can't quite remember what I was thinking about, half a year ago, but
>> what @ServiceProperties contains, is added as service properties when
>> registering the OSGi service:
>> https://github.com/sbang/jsr330activator/blob/master/jsr330activator.implementation/src/main/java/no/steria/osgi/jsr330activator/implementation/ProviderAdapter.java#L161

> I guess I was trying to do something like the activator in the sample
> does:
>  
> https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/whiteboard/src/main/java/org/ops4j/pax/web/extender/samples/whiteboard/internal/Activator.java#L67

> I also think there may be no way of doing this with DS, where the docs
> for the property argument of @Component, say:
[snip!]
>  String[] property() default {};

> Ie. it's limited to what a .properties file can represent, which is a
> list of name=value pairs, and no name=multiple-values.

> But I will be happy to be proved wrong...:-)

Looking at the pax whiteboard code, it looks like I might be able to use
a @WebServlet annotation on a Servlet @Component...?
 
https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/ServletTracker.java#L114
 
https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-api/src/main/java/org/ops4j/pax/web/utils/ServletAnnotationScanner.java#L40

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to