Bug 122561 Java event handler class is loaded multiple times
It appears that a Java event handler class is loaded twice for every time that an event is fired that requires the handler class. You would expect that the class is loaded once per Engine session. To reproduce, create a Java project in the workspace, set it to depend on the org.eclipse.birt.report.engine project, and drop in the attached CellEvenHandler.java file. Add the attached script_test.rptdesign file to a BIRT report project. Preview the report. You will find the following content in the output file "c:\scriptout.txt": Static init: org.eclipse.birt.test.CellEventHandler Static init: org.eclipse.birt.test.CellEventHandler org.eclipse.birt.test.CellEventHandler.onCreate Static init: org.eclipse.birt.test.CellEventHandler Static init: org.eclipse.birt.test.CellEventHandler org.eclipse.birt.test.CellEventHandler.onCreate Static init: org.eclipse.birt.test.CellEventHandler Static init: org.eclipse.birt.test.CellEventHandler org.eclipse.birt.test.CellEventHandler.onCreate Static init: org.eclipse.birt.test.CellEventHandler Static init: org.eclipse.birt.test.CellEventHandler org.eclipse.birt.test.CellEventHandler.onCreate Static init: org.eclipse.birt.test.CellEventHandler Static init: org.eclipse.birt.test.CellEventHandler org.eclipse.birt.test.CellEventHandler.onCreate Static init: org.eclipse.birt.test.CellEventHandler Static init: org.eclipse.birt.test.CellEventHandler org.eclipse.birt.test.CellEventHandler.onCreate Static init: org.eclipse.birt.test.CellEventHandler Static init: org.eclipse.birt.test.CellEventHandler org.eclipse.birt.test.CellEventHandler.onCreate Static init: org.eclipse.birt.test.CellEventHandler Check the Java class code and you will see that the CellEventHandler class is loaded twice for each Cell.onCreate event. This is a rather serious problem: the event handler class cannot use any static field to persist data across events. It causes very bad scripting performance since loading a class is an expensive operation. It appears that the problem resides in Engine's class loading logic: it uses a new class loader every time an event is fired to load the necessary event handler.
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ExecutionContext.java
* @return current page number
	 */
	public long getPageNumber() {
		return pageNumber;
	}
	/**
	 * get the total page have been created.
	 * 
	 * @return total page
	 */
	public long getTotalPage() {
		return totalPage;
	}
	/**
	 * is in factory mode
	 * 
	 * @return true, factory mode, false not in factory mode
	 */
	public boolean isInFactory() {
		return factoryMode;
	}
	/**
	 * is in presentation mode.
	 * 
	 * @return true, presentation mode, false otherwise
	 */
	public boolean isInPresentation() {
		return presentationMode;
	}
	/**