Restart myself - can I reinitialize everything from scratch?

后端 未结 6 1441
無奈伤痛
無奈伤痛 2021-01-27 01:27

I have something like this:

public static final String path;
static {
    path = loadProperties(\"config.conf\").getProperty(\"path\");
}

public static void mai         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-27 02:26

    If your goal is simply to reload some configuration files, why not implement a file change monitor?

    Here's a good tutorial on this subject:

    http://download.oracle.com/javase/tutorial/essential/io/notification.html

    I think what you're proposing (restarting your application automatically) would be a little more cumbersome than just watching for file updates.

提交回复
热议问题