/** Exit NetBeans with the given exit code. * This method will return only if {@link java.lang.System#exit} fails, or if at least one component of the * system refuses to exit (because it cannot be properly shut down). The * default implementation calls {@link #exit()} for compatibility reasons, * but subclasses are encouraged to provide better implementation. * * @param status the exit code of the application * @since 8.23 */ public void exit(int status) { exit(); }
/** Exit NetBeans with the given exit code. * This method will return only if {@link java.lang.System#exit} fails, or if at least one component of the * system refuses to exit (because it cannot be properly shut down). The * default implementation calls {@link #exit()} for compatibility reasons, * but subclasses are encouraged to provide better implementation. * * @param status the exit code of the application * @since 8.23 */ public void exit(int status) { exit(); }
/** Exit NetBeans with the given exit code. * This method will return only if {@link java.lang.System#exit} fails, or if at least one component of the * system refuses to exit (because it cannot be properly shut down). The * default implementation calls {@link #exit()} for compatibility reasons, * but subclasses are encouraged to provide better implementation. * * @param status the exit code of the application * @since 8.23 */ public void exit(int status) { exit(); }
private void exit() { LifecycleManager.getDefault().exit(); }
@Override public void run() { LifecycleManager.getDefault().exit(); }
@Override public void publish(LogRecord record) { if (record.getThrown() == null) { return; } throwable = record.getThrown(); if (throwable != null && throwable instanceof OutOfMemoryError) { Handler[] handlers = Logger.getLogger("").getHandlers(); for (int i = 0; i < handlers.length; i++) { Handler h = handlers[i]; h.close(); } NotifyDescriptor nd = new NotifyDescriptor.Message(MEMORY_ERROR, NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(nd); LifecycleManager.getDefault().exit(); } }
private void terminate() { synchronized (lock) { long ptime = ParserQueue.instance().getStopWatchTime(); System.err.println("disposing at " + ptime); // NOI18N String xmlOutput = System.getProperty("cnd.close.report.xml"); // NOI18N if (xmlOutput != null) { BufferedWriter out; try { out = new BufferedWriter(new FileWriter(xmlOutput, true)); String result = timeout ? "failed" : "passed"; // NOI18N out.write("<result>" + result + "</result>"); // NOI18N out.write("<parsetime>" + ptime + "</parsetime>"); // NOI18N out.close(); } catch (IOException ex) { DiagnosticExceptoins.register(ex); } } } LifecycleManager.getDefault().exit(); } }
writer.close(); LifecycleManager.getDefault().exit();
@Override public void shutdown(boolean restart) { if(restart) { LifecycleManager.getDefault().markForRestart(); } LifecycleManager.getDefault().exit(); }
LifecycleManager.getDefault().markForRestart(); } catch (UnsupportedOperationException uex) { LifecycleManager.getDefault().exit();
LifecycleManager.getDefault().exit();
private static void maybeDie(Object o) { // finish starting if (System.getProperty("netbeans.kill") != null) { org.netbeans.TopSecurityManager.exit(5); } // close IDE if (System.getProperty("netbeans.close") != null) { if (Boolean.getBoolean("netbeans.warm.close")) { try { // Do other stuff related to startup, to measure the effect. // synchronous MainLookup.warmUp(0).waitFinished(); // synchronous } catch (Exception ex) { Exceptions.printStackTrace(ex); } } if (o != null) { StartLog.logMeasuredStartupTime((Long) o); } org.openide.LifecycleManager.getDefault().exit(); } }
public void upgrade() { String currentVersion = getCurrentVersion(); Logger.getLogger("").log(Level.INFO, "Current Version is {0}", currentVersion); String lastVersion = NbPreferences.forModule(Upgrader.class).get(UPGRADER_LAST_VERSION, null); if (lastVersion == null || !lastVersion.equals(currentVersion)) { File latestPreviousVersion = checkPrevious(); if (latestPreviousVersion != null && !latestPreviousVersion.getName().replace(".", "").equals(currentVersion)) { File source = new File(latestPreviousVersion, "dev"); File dest = new File(System.getProperty("netbeans.user")); if (source.exists() && dest.exists()) { NbPreferences.forModule(Upgrader.class).put(UPGRADER_LAST_VERSION, currentVersion); boolean confirm = showUpgradeDialog(latestPreviousVersion); if (confirm) { try { CopyFiles.copyDeep(source, dest); //Restart if (showRestartDialog()) { LifecycleManager.getDefault().markForRestart(); LifecycleManager.getDefault().exit(); } } catch (IOException ex) { Exceptions.printStackTrace(ex); } } } } } }
public void run() { Frame f = WindowManager.getDefault().getMainWindow(); if (f == null || f.isShowing()) { LifecycleManager.getDefault().exit(); } else { f.addWindowListener(new WindowAdapter() { public @Override void windowOpened(WindowEvent e) { LifecycleManager.getDefault().exit(); } }); } } });
private void restart() { if (isDebug()) { return; } //Restart if (canRestart()) { //On Mac the change is applied only if restarted manually LifecycleManager.getDefault().markForRestart(); } LifecycleManager.getDefault().exit(); } }
public void run() { Frame f = WindowManager.getDefault().getMainWindow(); if (f == null || f.isShowing()) { LifecycleManager.getDefault().exit(); } else { f.addWindowListener(new WindowAdapter() { public @Override void windowOpened(WindowEvent e) { LifecycleManager.getDefault().exit(); } }); } } });