Collections.sort(linkResources);
Collections.sort(scriptResources);
Collections.sort(navigationLinks);
// bind the aggregate JAX-RS application to a dedicated servlet
ServletContainer container = new ServletContainer(app);
Bundle appBundle = componentContext.getBundleContext().getBundle();
httpService.registerServlet(applicationAlias, container, getInitParams(), new BundleHttpContext(
appBundle));
registeredAliases.add(applicationAlias);
// forward the main Stanbol OSGi runtime context so that JAX-RS resources can lookup arbitrary
// services
servletContext = container.getServletContext();
servletContext.setAttribute(BundleContext.class.getName(), componentContext.getBundleContext());
servletContext.setAttribute(BaseStanbolResource.ROOT_URL, applicationAlias);
servletContext.setAttribute(BaseStanbolResource.STATIC_RESOURCES_ROOT_URL, staticUrlRoot);
servletContext.setAttribute(BaseStanbolResource.LINK_RESOURCES, linkResources);
servletContext.setAttribute(BaseStanbolResource.SCRIPT_RESOURCES, scriptResources);