{
String pageName = cycle.getParameter(ServiceConstants.PAGE);
String componentId = cycle.getParameter(ServiceConstants.COMPONENT);
IPage page = cycle.getPage(pageName);
IComponent component = page.getNestedComponent(componentId);
try
{
IChartProvider provider = (IChartProvider) component;
Chart chart = provider.getChart();
OutputStream output = _response.getOutputStream(new ContentType("image/jpeg"));
// I've seen a few bits of wierdness (including a JVM crash) inside this code.
// Hopefully, its a multi-threading problem that can be resolved
// by synchronizing.
synchronized (this)
{
JPEGEncoder13.encode(chart, 1.0f, output);
}
}
catch (ClassCastException ex)
{
_exceptionReporter.reportRequestException("Component " + component.getExtendedId()
+ " does not implement IChartProvider.", ex);
return;
}
catch (Throwable ex)