*/
public void renderNow( ContentFragment fragment, RequestContext requestContext )
{
HttpServletRequest servletRequest =null;
HttpServletResponse servletResponse = null;
ContentDispatcherCtrl dispatcher = null;
boolean contentIsCached = false;
try
{
PortletWindow portletWindow = getPortletWindow(fragment);
PortletDefinitionComposite portletDefinition =
(PortletDefinitionComposite) portletWindow.getPortletEntity().getPortletDefinition();
if (checkSecurityConstraints && !checkSecurityConstraint(portletDefinition, fragment))
{
throw new PortletAccessDeniedException("Access Denied.");
}
if (portletTracking.isOutOfService(portletWindow))
{
log.info("Taking portlet out of service: " + portletDefinition.getUniqueName() + " for window " + fragment.getId());
fragment.overrideRenderedContent(OUT_OF_SERVICE_MESSAGE);
return;
}
long timeoutMetadata = this.getTimeoutOnJob(portletDefinition);
portletTracking.setExpiration(portletWindow, timeoutMetadata);
int expirationCache = getExpirationCache(portletDefinition);
if (expirationCache != 0)
{
if (retrieveCachedContent(requestContext, fragment, portletWindow, expirationCache, portletDefinition))
return;
contentIsCached = true;
}
if (dispatcher == null)
{
dispatcher = createDispatcher(requestContext, fragment, expirationCache);
}
servletRequest = requestContext.getRequestForWindow(portletWindow);
servletResponse = dispatcher.getResponseForWindow(portletWindow, requestContext);
RenderingJob rJob =
buildRenderingJob(portletWindow, fragment, servletRequest, servletResponse,
requestContext, false, portletDefinition, dispatcher, null,
expirationCache, contentIsCached, timeoutMetadata);
rJob.execute();