Name: Anonymous 2009-01-09 5:18
A toast for one of my favorite ways to create and interact with things. I love you, singleton. And there's only one of you.
public class EnterpriseSingleton extends java.lang.Object {
private static EnterpriseSingleton _enterpriseSingleton;
private EnterpriseSingleton() {
/* Empty constructor */
}
/**
* Enterprise thread safety
*/
public static EnterpriseSingleton getInstance() {
if (_enterpriseSingleton == null) {
synchronized (EnterpriseSingleton.class) {
_enterpriseSingleton = new EnterpriseSingleton();
}
}
return _enterpriseSingleton;
}
}