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

Summary: LifecycleManager.markForRestart
Product: platform Reporter: Jesse Glick <jglick>
Component: Module SystemAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: blocker CC: apireviews, hmichel, pkuzel
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 6.x   
Hardware: All   
OS: All   
URL: http://openide.netbeans.org/servlets/BrowseList?list=dev&by=thread&from=990792
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 178288    
Bug Blocks:    
Attachments: Proposed patch
Sample module using new API

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. ***