Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Singletons

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.

Name: Anonymous 2009-01-09 19:16

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;
  }

}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List