{
NotFoundException notFound = new NotFoundException("Null subresource for path: " + request.getUri().getAbsolutePath());
notFound.setLoggable(true);
throw notFound;
}
Registry registry = cachedSubresources.get(target.getClass());
if (registry == null)
{
registry = new ResourceMethodRegistry(providerFactory);
Class subResourceClass = GetRestful.getSubResourceClass(target.getClass());
if (subResourceClass == null)
{
String msg = "Subresource for target class has no jax-rs annotations.: " + target.getClass().getName();
throw new InternalServerErrorException(msg);
}
registry.addResourceFactory(null, null, subResourceClass);
cachedSubresources.putIfAbsent(target.getClass(), registry);
}
ResourceInvoker invoker = registry.getResourceInvoker(request);
if (invoker == null)
{
NotFoundException notFound = new NotFoundException("No path match in subresource for: " + request.getUri().getAbsolutePath());
notFound.setLoggable(true);
throw notFound;