registry.getServiceDiscovery(),
"javax.ws.rs.ext.RuntimeDelegate",
"/META-INF/wink-alternate-shortcuts.properties",
"/META-INF/server/wink-providers");
DeploymentConfiguration config = null;
try {
config = super.getDeploymentConfiguration();
} finally {
if (cl != null) {
// return previous classLoader
Thread.currentThread().setContextClassLoader(cl);
}
}
// [rfeng] FIXME: This is a hack to fool Apache wink to not remove the servlet path
config.setFilterConfig(new FilterConfig() {
public ServletContext getServletContext() {
return getServletContext();
}
public Enumeration getInitParameterNames() {
return getInitParameterNames();
}
public String getInitParameter(String arg0) {
return getInitParameter(arg0);
}
public String getFilterName() {
return getServletName();
}
});
ProvidersRegistry providers = config.getProvidersRegistry();
providers.addProvider(new DataBindingJAXRSReader(registry), 0.2, true);
providers.addProvider(new DataBindingJAXRSWriter(registry), 0.2, true);
config.getResponseUserHandlers().add(new TuscanyResponseHandler());
return config;
}