public class SingletonClass {
public static SingletonClass instance = null;
public SingletonClass() throws Throwable {
/* ... */
}
public static SingletonClass getInstance() throws Throwable {
if ( instance == null ) {
synhronized {
if ( instance == null ) {
instance = new SingletonClass();
}
}
}
return instance;
}
}