use of org.restlet.ext.jaxrs.JaxRsApplication in project xwiki-platform by xwiki.
the class XWikiRestletServlet method createApplication.
@Override
protected Application createApplication(Context context) {
Context applicationContext = context.createChildContext();
/* Retrieve the component manager and make it available in the restlet application context. */
ComponentManager componentManager = getComponentManager();
applicationContext.getAttributes().put(Constants.XWIKI_COMPONENT_MANAGER, componentManager);
JaxRsApplication application;
try {
application = componentManager.getInstance(JaxRsApplication.class);
} catch (ComponentLookupException e) {
log("Failed to lookup default JAX-RS Application", e);
return null;
}
application.setContext(applicationContext);
// Make the servlet available
try {
JaxRsServletProvider applicationProvider = componentManager.getInstance(JaxRsServletProvider.class);
applicationProvider.setApplication(this);
} catch (ComponentLookupException e) {
log("Failed to lookup JaxRsApplicationProvider. Dyncamically added/removed resources won'tbe supported", e);
}
return application;
}
Aggregations