Re: how to avoid start a same application twice
Monday, November 18, 2002 02:03 AM
To avoid this you have to use Sigleton Design Pattarn. This design pattarn gives you the way to avoid the multiple instance of same object.
Singleton object has a static method, a private constructor and a boolean private variable. When you call this staic method this boolean variable get sets to true. And method calls the private constructor to give the object reference.
Your small java program has to be called from this Singleton class to ensure that no more than one object is created.
I hope you have understood.