This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
People sometimes want to restart the app. This can be accomplished using File targetUserdir = new File(System.getProperty("netbeans.user")); File restartFile = new File(targetUserdir, "var/restart"); if (!restartFile.exists()) { restartFile.createNewFile(); } (as in autoupdate.services.OperationSupportImpl) but there should be a supported API for it.
Please review this simple API addition.
Created attachment 84469 [details] Proposed patch
Created attachment 84470 [details] Sample module using new API
JR01: The proposed API makes sense, it'll be useful. Just a minor suggestion: why don't offer also a method LifecycleManager.getDefault().restart() instead of calling LM.makeForRestart() and LM.exit() for a immediately restart?
>>LifecycleManager.getDefault().restart() instead of calling LM.makeForRestart() and LM.exit() for a immediately restart? At last see also following issue BTW it is marked as wont fix http://www.netbeans.org/issues/show_bug.cgi?id=89998
To JR01 - since some use cases require marking without immediate restart, it seems simplest to keep the two independent operations as two separate methods. It is not onerous to call both in sequence. To theanuradha - thanks for reminder; the attached patch when run in JNLP mode will falsely return normally from markForRestart when in fact the app cannot be restarted. It needs to throw UnsupportedOperationException in this case.
*** Issue 89998 has been marked as a duplicate of this issue. ***
core-main #931e3fc693cb
Integrated into 'main-golden', will be available in build *200907150249* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/931e3fc693cb User: Jesse Glick <jglick@netbeans.org> Log: Issue #168257: LifecycleManager.markForRestart.
*** Bug 64457 has been marked as a duplicate of this bug. ***