use of org.osgi.service.repository.RepositoryContent in project aries by apache.
the class CustomResourceInstaller method install.
@Override
public Resource install() throws Exception {
try {
ContentHandler handler = subsystem.getBundleContext().getService(handlerRef);
if (handler != null) {
InputStream is = ((RepositoryContent) resource).getContent();
handler.install(is, ResourceHelper.getSymbolicNameAttribute(resource), type, subsystem, coordination);
addReference(resource);
return resource;
} else {
throw new Exception("Custom content handler not found: " + handlerRef);
}
} finally {
subsystem.getBundleContext().ungetService(handlerRef);
}
}
Aggregations