Respawning application after its death


/**
* Internal use only.
*/
public void handleError(String errMsg, Throwable t){
logger.log(Level.SEVERE, errMsg, t);
// user should add additional code to handle the error.
stop(); // stop the application
}

How absolute is "Internal use only" constraint? I'd like to assign some thread uncaught error handler to respawn application with stored state. May I use this "Internal use only" method to create new application thread on current thread failing?

Should I explicitly use setDefaultUncaughtExceptionHandler instead?

“internal use only” means “don’t call it yourself”. You can override it, of course.

maybe we should change that to “Called internally”

How about “Do not call, used automatically in case of uncaught error”

How about: “Do not call externally; automatically called internally in case of uncaught error”