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
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL: http://openide.netbeans.org/servlets/...
Keywords: API, API_REVIEW_FAST
: 64457 89998 (view as bug list)
Depends on: 178288
Blocks:
  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:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
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
Details

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()) {
    restartFile.createNewFile();
}

(as in autoupdate.services.OperationSupportImpl) 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 http://www.netbeans.org/issues/show_bug.cgi?id=89998 
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 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.
Comment 10 markiewb 2012-04-20 19:03:21 UTC
*** Bug 64457 has been marked as a duplicate of this bug. ***