protected void setTimeoutOnJob(long timeoutMetadata, RenderingJob rJob) { if (timeoutMetadata > 0) { rJob.setTimeout(timeoutMetadata); } else if (this.portletTracking.getDefaultPortletTimeout() > 0) { rJob.setTimeout(this.portletTracking.getDefaultPortletTimeout()); } }
/** * Wait for all rendering jobs in the collection to finish successfully or otherwise. * @param renderingJobs the Collection of rendering job objects to wait for. */ public void waitForRenderingJobs(List<RenderingJob> renderingJobs) { this.workMonitor.waitForRenderingJobs(renderingJobs); }
public void setExpiration(PortletWindow window, long expiration) { RenderTrackable trackable = (RenderTrackable)window; trackable.setExpiration(expiration); // * 1000); }
protected void processRenderingJob(RenderingJob job, boolean parallelOnly) { try { if (parallelOnly || job.getTimeout() > 0) { workMonitor.process(job); } else { job.execute(); } } catch (Exception e1) { log.error("render() failed: " + e1.toString(), e1); job.getFragment().overrideRenderedContent(e1.getLocalizedMessage()); } }
/** * Wait for all rendering jobs in the collection to finish successfully or otherwise. * @param renderingJobs the Collection of rendering job objects to wait for. */ public void waitForRenderingJobs(List<RenderingJob> renderingJobs) { try { for (RenderingJob job : renderingJobs) { PortletContent portletContent = job.getPortletContent(); synchronized (portletContent) { if (!portletContent.isComplete()) { portletContent.wait(); } } } } catch (Exception e) { log.error("Exception during synchronizing all portlet rendering jobs.", e); } }
public boolean exceededTimeout(long renderTime, PortletWindow window) { if (!isEnabled()) { return false; } RenderTrackable trackInfo = (RenderTrackable)window; long defaultTimeout = this.getDefaultPortletTimeout(); if (trackInfo.getExpiration() > 0) { return (renderTime > trackInfo.getExpiration()); } else if (defaultTimeout > 0) { return (renderTime > defaultTimeout); } return false; }
public void success(PortletWindow window) { if (!isEnabled()) { return ; } RenderTrackable trackable = (RenderTrackable)window; removeFromCache(window); trackingCounts.remove(window.getWindowId()); trackable.success(); }
public void run() { if (jobWorksMonitorEnabled || interruptOnTimeout) { this.job.setWorkerAttribute(WORKER_THREAD_ATTR, Thread.currentThread()); } this.job.run(); }
public void putIntoService(PortletWindow window) { RenderTrackable trackable = (RenderTrackable)window; removeFromCache(window); trackingCounts.remove(window.getWindowId()); trackable.setRenderTimeoutCount(0); }
public void takeOutOfService(PortletWindow window) { RenderTrackable trackable = (RenderTrackable)window; addToCache(window); trackingCounts.remove(window.getWindowId()); trackable.setRenderTimeoutCount((int)this.defaultPortletTimeout + 1); }
public void notifyContentComplete(RequestContext context, PortletWindow window) { PortletContent content = window.getFragment().getPortletContent(); if (content.getExpiration() != 0) { addToCache(context, content); } }
public PrintWriter getWriter() throws IOException, IllegalStateException { return portletContent.getWriter(); }
public RenderingJobImpl(PortletContainer container, PortletRenderer renderer, PortletDefinition portletDefinition, HttpServletRequest request, HttpServletResponse response, RequestContext requestContext, PortletWindow window, PortalStatistics statistics, int expirationCache) { this.container = container; this.renderer = renderer; this.portletTracking = renderer.getPortletTrackingManager(); this.statistics = statistics; this.portletDefinition = portletDefinition; this.request = request; this.response = response; this.requestContext = requestContext; this.window = window; this.expirationCache = expirationCache; }
public void setTitle(String title) { if (!isClosed()) { portletContent.setTitle(title); } }
public void resetBuffer() { if (!isClosed()) { portletContent.resetBuffer(); } }
public void reset() { if (!isClosed()) { portletContent.reset(); } }
public void setContentType(String contentType) { if (!isClosed()) { portletContent.setContentType(contentType); } }
public PortletTrackingInfo getOutOfServiceList(String fullPortletName) { CacheElement element = trackingCache.get(fullPortletName); if (element != null) { List<String> windows = (List<String>)element.getContent(); return new PortletTrackingInfo(fullPortletName, windows); } else { List<String> windows = new ArrayList<String>(); return new PortletTrackingInfo(fullPortletName, windows); } }
public void invoke( RequestContext request, ValveContext context ) throws PipelineException { try { aggregator.build(request); } catch (Exception e) { throw new PipelineException(e.toString(), e); } // Pass control to the next Valve in the Pipeline context.invokeNext( request ); }
public void invoke( RequestContext request, ValveContext context ) throws PipelineException { try { aggregator.build(request); } catch (Exception e) { throw new PipelineException(e); } // Pass control to the next Valve in the Pipeline context.invokeNext( request ); }