try {
broker = getPool().get(user);
final Configuration configuration = broker.getConfiguration();
final HttpRequest requestAdapter = new HttpServletRequestAdapter(
request,
new FilterInputStreamCacheConfiguration(){
@Override
public String getCacheClass() {
return (String)configuration.getProperty(Configuration.BINARY_CACHE_CLASS_PROPERTY);
}
});
final RestXqService service = getRegistry().findService(requestAdapter);
if(service != null) {
if(log.isTraceEnabled()) {
log.trace("Received " + requestAdapter.getMethod().name() + " request for \"" + requestAdapter.getPath() + "\" and found Resource Function \"" + service.getResourceFunction().getFunctionSignature() + "\" in module \"" + service.getResourceFunction().getXQueryLocation() + "\"");
}
service.service(
requestAdapter,
new HttpServletResponseAdapter(response),
new ResourceFunctionExecutorImpl(getPool(), request.getContextPath() + request.getServletPath(), request.getRequestURI()),
new RestXqServiceSerializerImpl(getPool())
);
} else {
if(log.isTraceEnabled()) {
log.trace("Received " + requestAdapter.getMethod().name() + " request for \"" + requestAdapter.getPath() + "\" but no suitable Resource Function found!");
}
super.service(request, response);
}
} catch(EXistException ee) {