}
private void processRequest(Message message) {
ProviderFactory providerFactory = ProviderFactory.getInstance(message);
RequestPreprocessor rp = providerFactory.getRequestPreprocessor();
if (rp != null) {
rp.preprocess(message, new UriInfoImpl(message, null));
if (message.getExchange().get(Response.class) != null) {
return;
}
}
// Global pre-match request filters
if (JAXRSUtils.runContainerRequestFilters(providerFactory, message, true, null)) {
return;
}
String requestContentType = (String)message.get(Message.CONTENT_TYPE);
if (requestContentType == null) {
requestContentType = "*/*";
}
String rawPath = HttpUtils.getPathToMatch(message, true);
//1. Matching target resource class
Service service = message.getExchange().get(Service.class);
List<ClassResourceInfo> resources = ((JAXRSServiceImpl)service).getClassResourceInfos();
String acceptTypes = HttpUtils.getProtocolHeader(message, Message.ACCEPT_CONTENT_TYPE, null);
if (acceptTypes == null) {
acceptTypes = "*/*";
message.put(Message.ACCEPT_CONTENT_TYPE, acceptTypes);
}
List<MediaType> acceptContentTypes = null;
try {
acceptContentTypes = JAXRSUtils.sortMediaTypes(acceptTypes);
} catch (IllegalArgumentException ex) {
throw new WebApplicationException(406);
}
message.getExchange().put(Message.ACCEPT_CONTENT_TYPE, acceptContentTypes);
MultivaluedMap<String, String> values = new MetadataMap<String, String>();
ClassResourceInfo resource = JAXRSUtils.selectResourceClass(resources,
rawPath,
values,
message);
if (resource == null) {
org.apache.cxf.common.i18n.Message errorMsg =
new org.apache.cxf.common.i18n.Message("NO_ROOT_EXC",
BUNDLE,
message.get(Message.REQUEST_URI),
rawPath);
LOG.warning(errorMsg.toString());
Response resp = JAXRSUtils.createResponse(resource, message, errorMsg.toString(),
Response.Status.NOT_FOUND.getStatusCode(), false);
throw new WebApplicationException(resp);
}
message.getExchange().put(JAXRSUtils.ROOT_RESOURCE_CLASS, resource);
String httpMethod = HttpUtils.getProtocolHeader(message, Message.HTTP_REQUEST_METHOD, "POST");
OperationResourceInfo ori = null;
boolean operChecked = false;
List<ProviderInfo<RequestHandler>> shs = providerFactory.getRequestHandlers();
for (ProviderInfo<RequestHandler> sh : shs) {
if (ori == null && !operChecked) {
try {
ori = JAXRSUtils.findTargetMethod(resource,
message, httpMethod, values,