List<SubResourceInstance> subResources,
MessageContext context,
HandlersChain chain) throws Throwable {
ResourceRegistry registry = context.getAttribute(ResourceRegistry.class);
SearchResult result = context.getAttribute(SearchResult.class);
ResourceInstance resource = result.getResource();
SubResourceRecord subResourceRecord = subResourceInstance.getRecord();
String pattern = subResourceRecord.getTemplateProcessor().getPatternString();
// dispatch to one of the sub-resource methods.
SubResourceInstance method = null;
try {