use of org.xwiki.resource.events.ResourceReferenceHandlingEvent in project xwiki-platform by xwiki.
the class DefaultResourceReferenceHandlerChain method handleNext.
@Override
public void handleNext(ResourceReference reference) throws ResourceReferenceHandlerException {
if (!this.handlerStack.isEmpty()) {
ResourceReferenceHandler<?> handler = this.handlerStack.poll();
if (this.observation != null) {
this.observation.notify(new ResourceReferenceHandlingEvent(reference), handler);
}
ResourceReferenceHandlerException exception = null;
try {
handler.handle(reference, this);
} catch (ResourceReferenceHandlerException e) {
exception = e;
} finally {
if (this.observation != null) {
this.observation.notify(new ResourceReferenceHandledEvent(reference), handler, exception);
}
}
// Throw the exception if any
if (exception != null) {
throw exception;
}
}
}
Aggregations