So I see three ways to get rid of this problem -
1. Synchronize the code inside static method.
2. Make the class containing the static method implement a Prototype pattern(returning a cloned reference of self to each callee), make the method non-static. Thus on the returned cloned reference, each callee will invoke the "now non-static method" and get the work done.
3. Make the method non-static and each callee will invoke new Class().method()
Synchronizing the code inside static method seems a bottleneck, as this static method in this class will be called simultaneously by huge number of classes
Though I need to modify many classes, Point 2/3 looks more sensible. Guys Please advice which of this is a clean way to accomplish this. Still thinking whether there is any other cleaner way :roll:
[ October 30, 2007: Message edited by: Janarthan S Sathiamurthy ]