// thrown
ResourceRegistry registry = context.getAttribute(ResourceRegistry.class);
SearchResult result = context.getAttribute(SearchResult.class);
ResourceInstance resource = result.getResource();
MethodRecord method = null;
try {
// if no method is found then a RequestMatchingException exception
// is thrown
method = registry.findMethod(resource, context);
} catch (WebApplicationException e) {
// couldn't find a method
result.setError(e);
return;
}
result.setFound(true);
result.setMethod(method);
// continue the chain to invoke the method
if (logger.isTraceEnabled()) {
MethodMetadata metadata = (method == null) ? null : method.getMetadata();
logger.trace("Found root resource method to invoke: {} ", metadata); //$NON-NLS-1$
}
chain.doChain(context);
}