Lines 612-618
Link Here
|
612 |
} |
612 |
} |
613 |
|
613 |
|
614 |
public void doRestart (Restarter restarter, ProgressHandle progress) throws OperationException { |
614 |
public void doRestart (Restarter restarter, ProgressHandle progress) throws OperationException { |
615 |
createRestartMarker(); |
615 |
LifecycleManager.getDefault().markForRestart(); |
616 |
LifecycleManager.getDefault ().exit (); |
616 |
LifecycleManager.getDefault ().exit (); |
617 |
// if exit&restart fails => use restart later as fallback |
617 |
// if exit&restart fails => use restart later as fallback |
618 |
doRestartLater (restarter); |
618 |
doRestartLater (restarter); |
Lines 620-643
Link Here
|
620 |
|
620 |
|
621 |
public void doRestartLater (Restarter restarter) { |
621 |
public void doRestartLater (Restarter restarter) { |
622 |
// shedule module for restart |
622 |
// shedule module for restart |
623 |
createRestartMarker(); |
623 |
LifecycleManager.getDefault().markForRestart(); |
624 |
if(affectedModules!=null) { |
624 |
if(affectedModules!=null) { |
625 |
for (UpdateElement el : affectedModules) { |
625 |
for (UpdateElement el : affectedModules) { |
626 |
UpdateUnitFactory.getDefault().scheduleForRestart (el); |
626 |
UpdateUnitFactory.getDefault().scheduleForRestart (el); |
627 |
} |
627 |
} |
628 |
} |
628 |
} |
629 |
} |
629 |
} |
630 |
private void createRestartMarker() { |
|
|
631 |
try { |
632 |
File targetUserdir = new File(System.getProperty("netbeans.user")); // NOI18N |
633 |
File restartFile = new File(targetUserdir, "var/restart");//NOI18N |
634 |
if(!restartFile.exists()) { |
635 |
restartFile.createNewFile(); |
636 |
} |
637 |
} catch (IOException ex) { |
638 |
LOGGER.log(Level.INFO, "Can`t create restart file marker", ex); |
639 |
} |
640 |
} |
641 |
} |
630 |
} |
642 |
|
631 |
|
643 |
private static class ForCustomUninstall extends OperationSupportImpl { |
632 |
private static class ForCustomUninstall extends OperationSupportImpl { |
Lines 691-697
Link Here
|
691 |
} |
680 |
} |
692 |
|
681 |
|
693 |
public void doRestart (Restarter restarter, ProgressHandle progress) throws OperationException { |
682 |
public void doRestart (Restarter restarter, ProgressHandle progress) throws OperationException { |
694 |
createRestartMarker(); |
683 |
LifecycleManager.getDefault().markForRestart(); |
695 |
LifecycleManager.getDefault ().exit (); |
684 |
LifecycleManager.getDefault ().exit (); |
696 |
// if exit&restart fails => use restart later as fallback |
685 |
// if exit&restart fails => use restart later as fallback |
697 |
doRestartLater (restarter); |
686 |
doRestartLater (restarter); |
Lines 699-722
Link Here
|
699 |
|
688 |
|
700 |
public void doRestartLater (Restarter restarter) { |
689 |
public void doRestartLater (Restarter restarter) { |
701 |
// shedule module for restart |
690 |
// shedule module for restart |
702 |
createRestartMarker(); |
691 |
LifecycleManager.getDefault().markForRestart(); |
703 |
if(affectedModules!=null) { |
692 |
if(affectedModules!=null) { |
704 |
for (UpdateElement el : affectedModules) { |
693 |
for (UpdateElement el : affectedModules) { |
705 |
UpdateUnitFactory.getDefault().scheduleForRestart (el); |
694 |
UpdateUnitFactory.getDefault().scheduleForRestart (el); |
706 |
} |
695 |
} |
707 |
} |
696 |
} |
708 |
} |
697 |
} |
709 |
private void createRestartMarker() { |
|
|
710 |
try { |
711 |
File targetUserdir = new File(System.getProperty("netbeans.user")); // NOI18N |
712 |
File restartFile = new File(targetUserdir, "var/restart");//NOI18N |
713 |
if(!restartFile.exists()) { |
714 |
restartFile.createNewFile(); |
715 |
} |
716 |
} catch (IOException ex) { |
717 |
LOGGER.log(Level.INFO, "Can`t create restart file marker", ex); |
718 |
} |
719 |
|
720 |
} |
721 |
} |
698 |
} |
722 |
} |
699 |
} |