log.info("(Re)initializing the Stanbol Jersey subsystem");
// register all the JAX-RS resources into a a JAX-RS application and bind it to a configurable URL
// prefix
DefaultApplication app = new DefaultApplication();
String staticUrlRoot = (String) componentContext.getProperties().get(
STATIC_RESOURCES_URL_ROOT_PROPERTY);
String applicationAlias = (String) componentContext.getProperties().get(ALIAS_PROPERTY);
// incrementally contribute fragment resources
List<LinkResource> linkResources = new ArrayList<LinkResource>();
List<ScriptResource> scriptResources = new ArrayList<ScriptResource>();
for (WebFragment fragment : webFragments) {
log.debug("Registering web fragment '{}' into jaxrs application", fragment.getName());
linkResources.addAll(fragment.getLinkResources());
scriptResources.addAll(fragment.getScriptResources());
navigationLinks.removeAll(fragment.getNavigationLinks());
navigationLinks.addAll(fragment.getNavigationLinks());
app.contributeClasses(fragment.getJaxrsResourceClasses());
app.contributeSingletons(fragment.getJaxrsResourceSingletons());
}
app.contributeSingletons(components);
Collections.sort(linkResources);
Collections.sort(scriptResources);
Collections.sort(navigationLinks);
// bind the aggregate JAX-RS application to a dedicated servlet