}
}
public void killJobWork(RenderingJobCommonjWork jobWork)
{
RenderingJob job = jobWork.getRenderingJob();
try
{
if (log.isWarnEnabled())
{
PortletWindow window = job.getWindow();
log.warn("Portlet Rendering job to be interrupted by timeout (" + job.getTimeout() + "ms)" + (window != null ? ": "+window.getId().getStringId() : ""));
}
PortletContent content = job.getPortletContent();
Thread worker = (Thread) job.getWorkerAttribute(WORKER_THREAD_ATTR);
if (worker != null)
{
synchronized (content)
{
if (!content.isComplete())
{
worker.interrupt();
content.wait();
}
}
}
}
catch (Exception e)
{
log.error("Exceptiong during job killing.", e);
}
finally
{
WorkItem workItem = (WorkItem) job.getWorkerAttribute(COMMONJ_WORK_ITEM_ATTR);
if (workItem != null)
{
removeMonitoredJobWork(workItem);
}