de.laures.cewolf
Class CewolfRenderer

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by de.laures.cewolf.CewolfRenderer
All Implemented Interfaces:
CewolfRendererMBean, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CewolfRenderer
extends javax.servlet.http.HttpServlet
implements CewolfRendererMBean

The rendering servlet of Cewolf. It is resposible for writing an entire chart img into the response stream of the client. Everything needed for this is prepared already by the ChartImgTag resp. LegendTag. The ID of a chart image is passed to this servlet as a request parameter. After that the image object is retrieved from the server side session based image cache. This servlet must be configured in web.xml of the web application in order to use Cewolf services. The servlet's URL relative to the web apps root is used as the renderer attribute of the ChartImgTag resp. LegendTag in the JSP page.

Author:
Guido Laures
See Also:
ChartImgTag, LegendTag, Serialized Form

Field Summary
static java.lang.String INIT_CONFIG
           
static java.lang.String WEB_ROOT_DIR
           
 
Constructor Summary
CewolfRenderer()
           
 
Method Summary
static void chartUsed(java.lang.String type)
           
static void cppUsed(ChartPostProcessor cpp)
           
 void destroy()
           
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes HTTP GET request.
 java.util.Map<java.lang.String,java.lang.Integer> getChartUsageDetails()
           
 java.util.Map<java.lang.String,java.lang.Integer> getCppUsageDetails()
           
 boolean getDebug()
           
 int getNumberChartPostProcessorsUsed()
           
 int getNumberChartsRendered()
           
 boolean getRenderingEnabled()
           
 java.util.Date getStartup()
           
 void init(javax.servlet.ServletConfig servletCfg)
           
 void printParameters(javax.servlet.http.HttpServletRequest request)
           
 void setDebug(boolean debugged)
           
 void setRenderingEnabled(boolean renderingEnabled)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT_CONFIG

public static final java.lang.String INIT_CONFIG
See Also:
Constant Field Values

WEB_ROOT_DIR

public static final java.lang.String WEB_ROOT_DIR
See Also:
Constant Field Values
Constructor Detail

CewolfRenderer

public CewolfRenderer()
Method Detail

init

public void init(javax.servlet.ServletConfig servletCfg)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

printParameters

public void printParameters(javax.servlet.http.HttpServletRequest request)

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Processes HTTP GET request. Renders the chart or the lengend into the client's response stream.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - servlet request
Throws:
javax.servlet.ServletException - when the production of data could not be handled by the configured DatasetProcuder
java.io.IOException

cppUsed

public static void cppUsed(ChartPostProcessor cpp)

chartUsed

public static void chartUsed(java.lang.String type)

getStartup

public java.util.Date getStartup()
Specified by:
getStartup in interface CewolfRendererMBean

getNumberChartsRendered

public int getNumberChartsRendered()
Specified by:
getNumberChartsRendered in interface CewolfRendererMBean

getNumberChartPostProcessorsUsed

public int getNumberChartPostProcessorsUsed()
Specified by:
getNumberChartPostProcessorsUsed in interface CewolfRendererMBean

getCppUsageDetails

public java.util.Map<java.lang.String,java.lang.Integer> getCppUsageDetails()
Specified by:
getCppUsageDetails in interface CewolfRendererMBean

getChartUsageDetails

public java.util.Map<java.lang.String,java.lang.Integer> getChartUsageDetails()
Specified by:
getChartUsageDetails in interface CewolfRendererMBean

getDebug

public boolean getDebug()
Specified by:
getDebug in interface CewolfRendererMBean

setDebug

public void setDebug(boolean debugged)
Specified by:
setDebug in interface CewolfRendererMBean

getRenderingEnabled

public boolean getRenderingEnabled()
Specified by:
getRenderingEnabled in interface CewolfRendererMBean

setRenderingEnabled

public void setRenderingEnabled(boolean renderingEnabled)
Specified by:
setRenderingEnabled in interface CewolfRendererMBean


cewolf tag library - web charts with JFreeChart