}
public boolean invoke(HttpServletRequest request, HttpServletResponse res, boolean returnErrors)
throws ServletException {
try {
String pathInfo = request.getPathInfo() == null ? "" : request.getPathInfo();
AbstractHTTPDestination d = destinationRegistry.getDestinationForPath(pathInfo, true);
if (d == null) {
if (!isHideServiceList && (request.getRequestURI().endsWith(serviceListRelativePath)
|| request.getRequestURI().endsWith(serviceListRelativePath + "/")
|| StringUtils.isEmpty(pathInfo)
|| "/".equals(pathInfo))) {
setBaseURLAttribute(request);
serviceListGenerator.service(request, res);
} else {
d = destinationRegistry.checkRestfulRequest(pathInfo);
if (d == null || d.getMessageObserver() == null) {
if (returnErrors) {
LOG.warning("Can't find the the request for "
+ request.getRequestURL() + "'s Observer ");
generateNotFound(request, res);
}
return false;
} else { // the request should be a restful service request
updateDestination(request, d);
invokeDestination(request, res, d);
}
}
} else {
EndpointInfo ei = d.getEndpointInfo();
Bus bus = d.getBus();
ClassLoaderHolder orig = null;
try {
ResourceManager manager = bus.getExtension(ResourceManager.class);
if (manager != null) {
ClassLoader loader = manager.resolveResource("", ClassLoader.class);