001    /**
002     * 
003     */
004    package org.wdssii.core;
005    
006    import java.util.TimeZone;
007    
008    import org.apache.commons.logging.Log;
009    import org.apache.commons.logging.LogFactory;
010    
011    /**
012     * 
013     * The initialize() method of this class needs to be invoked by every algorithm or process.
014     * 
015     * @author lakshman
016     *
017     */
018    public class WDSSII {
019            private static Log log = LogFactory.getLog(WDSSII.class);
020            
021            private static WDSSII singleton = new WDSSII();
022            
023            public static WDSSII getInstance(){
024                    return singleton;
025            }
026            
027            private TimeZone initialTimeZone;
028            
029            private WDSSII(){
030                    log.info("WDSS-II (c) University of Oklahoma and NOAA National Severe Storms Laboratory");
031                    // any other inits go here
032                    this.initialTimeZone = TimeZone.getDefault();
033                    TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
034                    if (log.isInfoEnabled()){
035                            log.info("Set default timezone to: " + TimeZone.getDefault());
036                    }
037            }
038            
039            /** The actual TimeZone before it was changed to UTC */
040            public TimeZone getInitialTimeZone(){
041                    return initialTimeZone;
042            }
043            
044    }