If you want a SINGLE, predefined and instantiated, DirContext THROUGHOUT the life of the program, then you CANNOT close it.
I suppose you can define an interface that declares all the functions of DirContext except close(). GetInstance() will be changed to return the interface name, where all users of your program will use the interface name. This way, users will not have direct access to close(). Note you will need another (public) function in your class SimApplicationContext called something like close() so you (not the users) can close it at the appropriate time.
On a side note: There is no need to specify '@return SlmApplicationContext' in your javadoc since its obvious from the function signature.
Also, in addition to javadoc on the functions, I like to put javadoc on the class name too (assuming you don't already have it) since no one will know what class SlmApplicationContext is for. Lastly, if DirContext is closed and someone tries to use it, I suspect it will throw an exception rather than instansiate a new one.
Thanks. Guys could you please share a snippet of how we can achieve the same without close()?