| || |
How to initialize a java object in InitAgenda()
I have a java class, and i want to create an object of that class in the Agenda, which should be accessible to all the threads. If i intialize the class-object in the InitAgenda() i am not able to access it outside, but i can define the Object in InitAgenda() and initialize it in the InitClient() and it works, but that will create seperate objects for each thread.
Basically the java-class does some file-handling and i do not want each thread to create an object of that class, but to share the static variables of that class, to reduce wastage of time and memory.
Re: How to initialize a java object in InitAgenda()
Ya the problem is solved.
We initialized and object like this in InitAgenda:
var CompareResponse_Object = new Packages.CompareResponse();
//loadWle will load the file into a static StringBuffer.
CompareResponseObject = new Packages.CompareResponse();
each thread will create an object of CompareResponse() class, but all will share the static StringBuffer.