Search in sources :

Example 1 with Properties

use of org.ops4j.pax.cdi.api.Properties in project aries by apache.

the class OsgiServiceProviderHandler method handleAnnotation.

private void handleAnnotation(AnnotatedElement annotatedElement, final String id, ContextEnricher contextEnricher) {
    final OsgiServiceProvider serviceProvider = annotatedElement.getAnnotation(OsgiServiceProvider.class);
    Properties properties = annotatedElement.getAnnotation(Properties.class);
    final List<String> interfaceNames = extractServiceInterfaces(serviceProvider);
    final List<ServiceProperty> serviceProperties = extractProperties(properties);
    contextEnricher.addBlueprintContentWriter("OsgiServiceProvider/" + annotatedElement + "/" + id, new XmlWriter() {

        @Override
        public void write(XMLStreamWriter writer) throws XMLStreamException {
            writeService(writer, serviceProperties, interfaceNames, id);
        }
    });
}
Also used : XMLStreamException(javax.xml.stream.XMLStreamException) XMLStreamWriter(javax.xml.stream.XMLStreamWriter) OsgiServiceProvider(org.ops4j.pax.cdi.api.OsgiServiceProvider) Properties(org.ops4j.pax.cdi.api.Properties) XmlWriter(org.apache.aries.blueprint.plugin.spi.XmlWriter)

Aggregations

XMLStreamException (javax.xml.stream.XMLStreamException)1 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)1 XmlWriter (org.apache.aries.blueprint.plugin.spi.XmlWriter)1 OsgiServiceProvider (org.ops4j.pax.cdi.api.OsgiServiceProvider)1 Properties (org.ops4j.pax.cdi.api.Properties)1