use of org.apache.aries.blueprint.plugin.spi.XmlWriter 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);
}
});
}
use of org.apache.aries.blueprint.plugin.spi.XmlWriter in project aries by apache.
the class ConfigPropertiesHandler method enrichContext.
private void enrichContext(ContextEnricher contextEnricher, final String pid, final boolean update, final String id) {
contextEnricher.addBean(id, Properties.class);
contextEnricher.addBlueprintContentWriter("properties/" + id, new XmlWriter() {
@Override
public void write(XMLStreamWriter writer) throws XMLStreamException {
writer.writeEmptyElement("cm-properties");
writer.writeDefaultNamespace("http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0");
writer.writeAttribute("id", id);
writer.writeAttribute("persistent-id", pid);
writer.writeAttribute("update", String.valueOf(update));
}
});
}
Aggregations