if (!"hidden".equals(f.getState()))
{
if (child.getType().equals(ContentFragment.PORTLET))
{
// create and store the portlet rendering job into the jobs lists.
RenderingJob job = renderer.createRenderingJob(child, context);
// The returned job can be null for some reason, such as invalid portlet entity.
if (job != null)
{
if (job.getTimeout() > 0)
parallelJobs.add(job);
else
sequentialJobs.add(job);
}
}
else
{
// walk thru layout
// and store the layout rendering job into the layout jobs list.
aggregateAndRender(child, context, page, false, sequentialJobs, parallelJobs, layoutFragments);
layoutFragments.add(child);
}
}
}
}
// If the fragment is not root, skip the following.
if (!isRoot)
return;
CurrentWorkerContext.setCurrentWorkerContextUsed(parallelJobs.size() > 0 && sequentialJobs.size() > 0);
// kick off the parallel rendering jobs
Iterator iter = parallelJobs.iterator();
while (iter.hasNext())
{
RenderingJob job = (RenderingJob) iter.next();
renderer.processRenderingJob(job);
}
// kick off the sequential rendering jobs
iter = sequentialJobs.iterator();
while (iter.hasNext())
{
RenderingJob job = (RenderingJob) iter.next();
renderer.processRenderingJob(job);
}
// synchronize on completion of all jobs
iter = parallelJobs.iterator();
try
{
while (iter.hasNext())
{
RenderingJob job = (RenderingJob) iter.next();
PortletContent portletContent = job.getPortletContent();
if (!portletContent.isComplete())
{
synchronized (portletContent)
{