>>>>> 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: /** * Properties for this Component. * * <p> * Each property string is specified as {@code "name=value"}. The type of * the property value can be specified in the name as * {@code name:type=value}. The type must be one of the property types * supported by the type attribute of the property element of a Component * Description. * * <p> * To specify a property with multiple values, use multiple name, value * pairs. For example, {@code "foo=bar", "foo=baz"}. * * @see "The property element of a Component Description." */ 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...:-) -- -- ------------------ 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.
