/** * Constructs a <tt>Librarian</tt>. * * @param factory the factory * @param housekeeper the house keeper */ public Librarian(TargetFactory factory, Housekeeper housekeeper) { housekeeper.registerForCleanup(this); extension = '.' + factory.getNativeLibraryExtension(); }
/** * Terminates the installation process. * * @param exitSuccess if <tt>true</tt>, exits with a <tt>0</tt> exit code, else exits with a <tt>1</tt> exit code * @param reboot if <tt>true</tt> perform a reboot */ protected void terminate(boolean exitSuccess, boolean reboot) { housekeeper.shutDown(exitSuccess ? 0 : 1, reboot); }
protected void terminate(int exitCode, boolean reboot) { if (reboot) { try { systemReboot(); } catch (IOException exception) { // Do nothing at the moment logger.log(Level.WARNING, exception.getMessage(), exception); } } System.exit(exitCode); }
public void shutDown(int exitCode, boolean reboot) { // IZPACK-276 // Do the cleanup of the last registered client at the fist time (first in last out) for (int i = cleanupClients.size() - 1; i >= 0; i--) { try { (cleanupClients.get(i)).cleanUp(); } catch (Throwable exception) { // At this point we can not afford to treat exceptions. Cleanup that can not be completed might // unfortunately leave some garbage behind. logger.log(Level.WARNING, exception.getMessage(), exception); } } terminate(exitCode, reboot); }
Platform platform = platforms.getCurrentPlatform(); TargetFactory factory = new TargetFactory(new DefaultTargetPlatformFactory(dummy, platform, platforms)); Librarian librarian = new Librarian(factory, new Housekeeper()); System.out.println("(Java) Opening new file queue..."); WinSetupFileQueue fq = new WinSetupFileQueue(librarian, new WinSetupDefaultCallbackHandler());
/** * Creates the temporary directory and sets the install data variable to point to it * * @throws IOException if creation of the directory fails */ public void create() throws IOException { try { tempdir = File.createTempFile(tempDirDescription.getPrefix(), tempDirDescription.getSuffix()); tempdir.delete(); tempdir.mkdir(); } catch (IOException e) { logger.log(Level.SEVERE, "Unable to create temporary directory for installation: " + e.getMessage(), e); throw e; } installData.setVariable(tempDirDescription.getVariableName(), tempdir.getAbsolutePath()); housekeeper.registerForCleanup(this); }
housekeeper.shutDown(1);
/** * Constructs a <tt>ShortcutPanelLogic</tt>. * * @param installData the installation data * @param resources the resources * @param uninstallData the uninstallation data * @param housekeeper the house keeper * @param factory the factory for platform-specific implementations * @param matcher the platform-model matcher * @throws Exception for any error */ public ShortcutPanelLogic(InstallData installData, Resources resources, UninstallData uninstallData, Housekeeper housekeeper, TargetFactory factory, InstallerListeners listeners, PlatformModelMatcher matcher) throws Exception { this.matcher = matcher; this.resources = resources; this.installData = installData; this.uninstallData = uninstallData; this.shortcut = factory.makeObject(Shortcut.class); this.shortcut.initialize(Shortcut.APPLICATIONS, "-"); if (!isCreateShortcutsImmediately()) { listeners.add(new LateShortcutInstallListener()); } this.defaultGroup = new Vector<String>(); defaultGroup.add(DEFAULT_FOLDER); housekeeper.registerForCleanup(this); }
@Override public void run() { if (langCode == null) { try { installerContainer.getComponent(LanguageDialog.class).initLangPack(); } catch (Exception ex) { logger.severe("The language pack couldn't be initialized."); } } else { installerContainer.getComponent(LanguageDialog.class).propagateLocale(langCode); } if (!installerContainer.getComponent(RequirementsChecker.class).check()) { logger.info("Not all installer requirements are fulfilled."); installerContainer.getComponent(Housekeeper.class).shutDown(-1); } } });
private void afterPacks(List<Pack> packs) throws NativeLibException, InstallerException housekeeper.registerForCleanup(this);
housekeeper.shutDown(0);
housekeeper.shutDown(0, reboot);
housekeeper.shutDown(success ? 0 : 1, reboot);
housekeeper.shutDown(4);
installerContainer.getComponent(Housekeeper.class).shutDown(-1);