if (!(this.portletInstance instanceof ResourceServingPortlet)) {
throw new NoHandlerFoundException("Cannot handle resource request - target portlet [" +
this.portletInstance.getClass() + " does not implement ResourceServingPortlet");
}
ResourceServingPortlet resourcePortlet = (ResourceServingPortlet) this.portletInstance;
// Delegate to PortletContentGenerator for checking and preparing.
checkAndPrepare(request, response);
// Execute in synchronized block if required.
if (isSynchronizeOnSession()) {
PortletSession session = request.getPortletSession(false);
if (session != null) {
Object mutex = PortletUtils.getSessionMutex(session);
synchronized (mutex) {
resourcePortlet.serveResource(request, response);
return null;
}
}
}
resourcePortlet.serveResource(request, response);
return null;
}