use of org.xwiki.resource.ResourceReferenceHandlerChain in project xwiki-platform by xwiki.
the class AbstractResourceReferenceHandlerManager method handle.
@Override
public void handle(ResourceReference reference) throws ResourceReferenceHandlerException {
// Look for a Handler supporting the Resource Type located in the passed Resource Reference object.
Set<ResourceReferenceHandler> orderedHandlers = getMatchingHandlers(extractResourceReferenceQualifier(reference));
if (!orderedHandlers.isEmpty()) {
// Create the Handler chain
ResourceReferenceHandlerChain chain = new DefaultResourceReferenceHandlerChain(orderedHandlers, this.observation);
// Call the first Handler
chain.handleNext(reference);
} else {
// Resource has not been handled since no Handler was found for it!
throw new NotFoundResourceHandlerException(reference);
}
}
Aggregations