开发者

One scriptlet instance for multiple reports

开发者 https://www.devze.com 2023-04-12 14:00 出处:网络
For multiple reports, I have a scriptlet that calls many web services. The calls are done开发者_如何学Go under the afterReportInit() method to fill a couple of HashMaps which in turn are used in the r

For multiple reports, I have a scriptlet that calls many web services. The calls are done开发者_如何学Go under the afterReportInit() method to fill a couple of HashMaps which in turn are used in the reports. The problem is that web services calls are performed at every report generation which results in very low performance.

I'm looking for a workaround to make thoses web services called once for all reports.

Note that reports are deployed on JasperServer


I'm looking into the thing. So far what I've found is that JasperReports has a custom class loader, JRClassLoader that would need to be extended:

http://grepcode.com/file/repo1.maven.org/maven2/net.sf.jasperreports/jasperreports/4.1.2/net/sf/jasperreports/engine/util/JRClassLoader.java#JRClassLoader.%3Cinit%3E%28java.lang.ClassLoader%29

I personally wouldn't bother with the class loading mechanism and would instead try caching the results of the web service calls using memcache if possible... Depending on your setup, apache could probably do this as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消