This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
First of all, I am not sure if I am posting my query in the correct forum.
If I need to change to a different forum, please let me know and I shall do the same.
How do we implement a singleton design pattern in a clustered environment?
This was an interview question for which I did not have an answer.
I understand singleton design pattern and the double checked locking as well.
Could someone explain me how we could implement Singleton in a clustered environment?
I don't think you can, (different JVMs means impossible to share same instance). And I think it would be a waste of time to try. Instead, you need to understand what requirement led to the 'need' for Singleton, then try to match that requirement rather than match the implementation. Read WhatNotHow as it pertains to this very nicely.