package kr.gmtc.gw.dev;

import java.time.ZoneId;
import java.util.TimeZone;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@SpringBootApplication
public class DevApplication {
        // implements CommandLineRunner
        // @Autowired
        // private ApplicationContext appContext;

	public static void main(String[] args) {
		//SpringApplication.run(SocketApplication.class, args);
		 ApplicationHome home = new ApplicationHome(DevApplication.class);
        String root = home.getDir().getPath();

        System.setProperty("user.dir", root);

        TimeZone.setDefault(TimeZone.getTimeZone(ZoneId.of("UTC")));

        Thread.currentThread().setName("JVM - Main");

        SpringApplication springApplication = new SpringApplication(DevApplication.class);

        springApplication.addListeners(new ApplicationPidFileWriter("./application.pid"));
        springApplication.run(args);

	}

        // @Override 
	// public void run(String...args) throws Exception {

        //         String [] beans = appContext.getBeanDefinitionNames();
        //         Arrays.sort(beans);
        //         for(String bean : beans ){
        //                 System.out.println(bean);
        //         }
        
        
        // }

}
