org.apache.jetspeed.aggregator.impl
Class RenderingJobImpl

java.lang.Object
  extended by org.apache.jetspeed.aggregator.impl.RenderingJobImpl
All Implemented Interfaces:
java.lang.Runnable, RenderingJob

public class RenderingJobImpl
extends java.lang.Object
implements RenderingJob

The RenderingJob is responsible for storing all necessary objets for asynchronous portlet rendering as well as implementing the rendering logic in its Runnable method.

Version:
$Id: RenderingJobImpl.java 592263 2007-11-06 04:19:20Z woonsan $
Author:
Rapha???l Luta, David Sean Taylor, Woonsan Ko

Field Summary
protected  org.apache.pluto.PortletContainer container
           
protected  boolean contentIsCached
           
protected  ContentDispatcherCtrl dispatcher
           
protected  int expirationCache
           
protected  ContentFragment fragment
           
protected static org.apache.commons.logging.Log log
          Commons logging
protected  PortletContent portletContent
           
protected  org.apache.pluto.om.portlet.PortletDefinition portletDefinition
           
protected  PortletTrackingManager portletTracking
           
protected  PortletRenderer renderer
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  RequestContext requestContext
           
protected  javax.servlet.http.HttpServletResponse response
           
protected  long startTimeMillis
           
protected  PortalStatistics statistics
           
protected  long timeout
           
protected  org.apache.pluto.om.window.PortletWindow window
          WorkerMonitor used to flush the queue
protected  java.util.Map workerAttributes
           
 
Constructor Summary
RenderingJobImpl(org.apache.pluto.PortletContainer container, PortletRenderer renderer, org.apache.pluto.om.portlet.PortletDefinition portletDefinition, PortletContent portletContent, ContentFragment fragment, ContentDispatcherCtrl dispatcher, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RequestContext requestContext, org.apache.pluto.om.window.PortletWindow window, PortalStatistics statistics, int expirationCache, boolean contentIsCached)
           
RenderingJobImpl(org.apache.pluto.PortletContainer container, PortletRenderer renderer, org.apache.pluto.om.portlet.PortletDefinition portletDefinition, PortletContent portletContent, ContentFragment fragment, ContentDispatcherCtrl dispatcher, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RequestContext requestContext, org.apache.pluto.om.window.PortletWindow window, PortalStatistics statistics, int expirationCache, boolean contentIsCached, java.util.Map workerAttrs)
           
 
Method Summary
 void execute()
           execute
 ContentDispatcherCtrl getDispatcher()
           
 int getExpirationCache()
           
 ContentFragment getFragment()
           
 PortletContent getPortletContent()
           getPortletContent
 org.apache.pluto.om.portlet.PortletDefinition getPortletDefinition()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 RequestContext getRequestContext()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 long getTimeout()
          Gets portlet timout in milliseconds.
 org.apache.pluto.om.window.PortletWindow getWindow()
           getWindow
 java.lang.Object getWorkerAttribute(java.lang.String name)
           
 boolean isContentCached()
           
 boolean isTimeout()
          Checks if the portlet rendering is timeout
 void removeWorkerAttribute(java.lang.String name)
           
 void run()
          Checks if queue is empty, if not try to empty it by calling the WorkerMonitor.
 void setTimeout(long timeout)
          Sets portlet timout in milliseconds.
 void setWorkerAttribute(java.lang.String name, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Commons logging


window

protected org.apache.pluto.om.window.PortletWindow window
WorkerMonitor used to flush the queue


request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response

container

protected org.apache.pluto.PortletContainer container

renderer

protected PortletRenderer renderer

fragment

protected ContentFragment fragment

requestContext

protected RequestContext requestContext

portletTracking

protected PortletTrackingManager portletTracking

portletDefinition

protected org.apache.pluto.om.portlet.PortletDefinition portletDefinition

portletContent

protected PortletContent portletContent

statistics

protected PortalStatistics statistics

dispatcher

protected ContentDispatcherCtrl dispatcher

contentIsCached

protected boolean contentIsCached

expirationCache

protected int expirationCache

workerAttributes

protected java.util.Map workerAttributes

startTimeMillis

protected long startTimeMillis

timeout

protected long timeout
Constructor Detail

RenderingJobImpl

public RenderingJobImpl(org.apache.pluto.PortletContainer container,
                        PortletRenderer renderer,
                        org.apache.pluto.om.portlet.PortletDefinition portletDefinition,
                        PortletContent portletContent,
                        ContentFragment fragment,
                        ContentDispatcherCtrl dispatcher,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        RequestContext requestContext,
                        org.apache.pluto.om.window.PortletWindow window,
                        PortalStatistics statistics,
                        int expirationCache,
                        boolean contentIsCached)

RenderingJobImpl

public RenderingJobImpl(org.apache.pluto.PortletContainer container,
                        PortletRenderer renderer,
                        org.apache.pluto.om.portlet.PortletDefinition portletDefinition,
                        PortletContent portletContent,
                        ContentFragment fragment,
                        ContentDispatcherCtrl dispatcher,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        RequestContext requestContext,
                        org.apache.pluto.om.window.PortletWindow window,
                        PortalStatistics statistics,
                        int expirationCache,
                        boolean contentIsCached,
                        java.util.Map workerAttrs)
Method Detail

setTimeout

public void setTimeout(long timeout)
Sets portlet timout in milliseconds.

Specified by:
setTimeout in interface RenderingJob

getTimeout

public long getTimeout()
Gets portlet timout in milliseconds.

Specified by:
getTimeout in interface RenderingJob

isTimeout

public boolean isTimeout()
Checks if the portlet rendering is timeout

Specified by:
isTimeout in interface RenderingJob

run

public void run()
Checks if queue is empty, if not try to empty it by calling the WorkerMonitor. When done, pause until next scheduled scan.

Specified by:
run in interface java.lang.Runnable

execute

public void execute()

execute

Specified by:
execute in interface RenderingJob

getWindow

public org.apache.pluto.om.window.PortletWindow getWindow()

getWindow

Specified by:
getWindow in interface RenderingJob
Returns:
The window this job is in charge of rendering

getPortletContent

public PortletContent getPortletContent()

getPortletContent

Specified by:
getPortletContent in interface RenderingJob
Returns:
The portlet content this job is in charge of rendering

getPortletDefinition

public org.apache.pluto.om.portlet.PortletDefinition getPortletDefinition()
Specified by:
getPortletDefinition in interface RenderingJob

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Specified by:
getRequest in interface RenderingJob

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Specified by:
getResponse in interface RenderingJob

getFragment

public ContentFragment getFragment()
Specified by:
getFragment in interface RenderingJob

getRequestContext

public RequestContext getRequestContext()
Specified by:
getRequestContext in interface RenderingJob

getExpirationCache

public int getExpirationCache()
Specified by:
getExpirationCache in interface RenderingJob

getDispatcher

public ContentDispatcherCtrl getDispatcher()
Specified by:
getDispatcher in interface RenderingJob

isContentCached

public boolean isContentCached()
Specified by:
isContentCached in interface RenderingJob

setWorkerAttribute

public void setWorkerAttribute(java.lang.String name,
                               java.lang.Object value)
Specified by:
setWorkerAttribute in interface RenderingJob

getWorkerAttribute

public java.lang.Object getWorkerAttribute(java.lang.String name)
Specified by:
getWorkerAttribute in interface RenderingJob

removeWorkerAttribute

public void removeWorkerAttribute(java.lang.String name)
Specified by:
removeWorkerAttribute in interface RenderingJob


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.