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.

Bug 168257 - LifecycleManager.markForRestart
Summary: LifecycleManager.markForRestart
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
: 64457 89998 (view as bug list)
Depends on: 178288
  Show dependency tree
Reported: 2009-07-08 00:09 UTC by Jesse Glick
Modified: 2012-04-20 19:03 UTC (History)
3 users (show)

See Also:
Exception Reporter:

Proposed patch (8.97 KB, patch)
2009-07-08 00:39 UTC, Jesse Glick
Details | Diff
Sample module using new API (4.62 KB, application/x-compressed)
2009-07-08 00:41 UTC, Jesse Glick

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-07-08 00:09:36 UTC
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()) {

(as in but there should be a supported API for it.
Comment 1 Jesse Glick 2009-07-08 00:38:49 UTC
Please review this simple API addition.
Comment 2 Jesse Glick 2009-07-08 00:39:34 UTC
Created attachment 84469 [details]
Proposed patch
Comment 3 Jesse Glick 2009-07-08 00:41:22 UTC
Created attachment 84470 [details]
Sample module using new API
Comment 4 Jiri Rechtacek 2009-07-08 09:07:04 UTC
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?
Comment 5 _ theanuradha 2009-07-08 12:54:43 UTC
>>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 
Comment 6 Jesse Glick 2009-07-08 17:39:23 UTC
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.
Comment 7 Jesse Glick 2009-07-08 17:39:44 UTC
*** Issue 89998 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2009-07-14 15:13:45 UTC
core-main #931e3fc693cb
Comment 9 Quality Engineering 2009-07-15 07:17:34 UTC
Integrated into 'main-golden', will be available in build *200907150249* on (upload may still be in progress)
User: Jesse Glick <>
Log: Issue #168257: LifecycleManager.markForRestart.
Comment 10 markiewb 2012-04-20 19:03:21 UTC
*** Bug 64457 has been marked as a duplicate of this bug. ***