Examples of InstallOptions


Examples of com.instantiations.installer.core.InstallOptions

  /**
   * Search for unused directories
   */
  protected IStatus run(Context installer) {
    InstallOptions options = installer.getOptions();
    boolean verbose = options.isVerbose();
    if (verbose)
      System.out.println("Scanning for unused directories");
    Collection result = findDirsMatching(verbose);
    StringBuffer buf = new StringBuffer(result.size() * 40);
    for (Iterator iter = result.iterator(); iter.hasNext();) {
      File installDir = (File) iter.next();
      if (buf.length() > 0)
        buf.append(",");
      buf.append(installDir.getPath());
    }
    options.set(OPTION_UNUSED_INSTALL_DIRS, buf.toString());
    return super.run(installer);
  }
View Full Code Here

Examples of com.instantiations.installer.core.InstallOptions

  /**
   * Queue the installations to be deleted
   */
  protected void prepare() throws Exception {
    InstallOptions options = installer.getOptions();
    boolean verbose = options.isVerbose();
    if (verbose)
      System.out.println("Preparing to delete old unused installations:");
    createCleanDirectoryOperation(installer.getOptions().getStrings(
      ScanUnlinkedInstallsOperation.OPTION_UNLINKED_INSTALL_DIRS), verbose, options);
    createCleanDirectoryOperation(installer.getOptions().getStrings(
View Full Code Here

Examples of com.instantiations.installer.core.InstallOptions

  /**
   * Search for unlinked installations
   */
  protected IStatus run(Context installer) {
    InstallOptions options = installer.getOptions();
    if (options.isVerbose())
      System.out.println("Scanning for unlinked installations");
    Collection result = new TreeSet();
    try {
      findUnlinkedDirs(rootDir, installer.getOptions(), result);
    }
    catch (ScanFailedException e) {
      System.out.println("Abort scan for unlinked installations because exception occurred");
      e.printStackTrace();
      result.clear();
    }
    StringBuffer buf = new StringBuffer(result.size() * 40);
    for (Iterator iter = result.iterator(); iter.hasNext();) {
      File installDir = (File) iter.next();
      if (buf.length() > 0)
        buf.append(",");
      buf.append(installDir.getPath());
    }
    options.set(OPTION_UNLINKED_INSTALL_DIRS, buf.toString());
    return super.run(installer);
  }
View Full Code Here

Examples of com.instantiations.installer.core.InstallOptions

  /**
   * Test to scan the Instantiations directory for unlinked directories
   */
  public static void main(String[] args) {
    InstallOptions options = new InstallOptions();
    options.setVerbose(true);
    Installer installer = new Installer(options) {
      protected Class getRequiredAdapterType() {
        return null;
      }
    };
   
    File rootDir = new File(args.length > 0 ? args[0] : "/Program Files/Instantiations");

    ScanUnlinkedInstallsOperation op = new ScanUnlinkedInstallsOperation(rootDir);
    long startTime = System.currentTimeMillis();
    op.run(installer);
    long elapseTime = System.currentTimeMillis() - startTime;

    String[] paths = options.getStrings(OPTION_UNLINKED_INSTALL_DIRS);
    System.out.println(paths.length + " unlinked install directories found in " + elapseTime + " milliseconds");
    for (int i = 0; i < paths.length; i++)
      System.out.println("  " + trimmedPath(paths[i], rootDir));
  }
View Full Code Here

Examples of com.instantiations.installer.core.InstallOptions

   * Run the installer
   *
   * @param args command line arguments
   */
  protected void run(String[] args) throws Exception {
    options = new InstallOptions(getClass(), "install.properties");
    options.set("InstallDir", new File(Platform.getVarString("ProgramFiles"), options.getString("InstallDirName")).getAbsolutePath());
    options.setUninstall(isUninstaller());
    options.setAllowOverwrite(true);
    options.setNoOverwriteWarningDuringInstall(true);
    options.setBoolean(ChooseLocationStep.OPTION_SUPPRESS_ALREADY_INSTALLED_WARNING, true);
View Full Code Here

Examples of io.fabric8.process.manager.InstallOptions

        Installation installation = null;
        try {
            if (ChildContainers.isJavaContainer(fabricService, options)) {
                LOG.debug("Java container detected - installing jar. Configuration: ", options);
                JavaContainerConfig javaConfig = createJavaContainerConfig(options);
                InstallOptions parameters = createJavaInstallOptions(container, metadata, options, javaConfig, environmentVariables);
                String layout = javaConfig.getOverlayFolder();
                InstallTask postInstall = createCommonPostInstal(options, environmentVariables, layout);
                Objects.notNull(parameters, "JavaInstall parameters");
                installation = procManager.installJar(parameters, postInstall);
            } else {
                LOG.debug("Process container detected - installing process. Configuration: ", options);
                InstallOptions parameters = createProcessInstallOptions(container, metadata, options, processConfig, environmentVariables);
                InstallTask postInstall = createProcessPostInstall(container, options, processConfig, environmentVariables);
                Objects.notNull(parameters, "process parameters");
                installation = procManager.install(parameters, postInstall);
            }
        } catch (Exception e) {
View Full Code Here

Examples of io.fabric8.process.manager.InstallOptions

        // Given
        String mainJar = "mvn:org.apache.camel/camel-xstream/2.12.0";
        javaContainerConfig.setJarUrl(mainJar);

        // When
        InstallOptions installOptions = managerController.createJavaInstallOptions(container, containerMetadata, containerOptions, javaContainerConfig, new HashMap<String, String>());

        // Then
        assertEquals(new URL(mainJar), installOptions.getUrl());
    }
View Full Code Here

Examples of io.fabric8.process.manager.InstallOptions

    }

    @Test
    public void shouldIgnoreNullJarUrlInJavaContainerConfig() throws Exception {
        // When
        InstallOptions installOptions = managerController.createJavaInstallOptions(container, containerMetadata, containerOptions, javaContainerConfig, new HashMap<String, String>());

        // Then
        assertNull(installOptions.getUrl());
    }
View Full Code Here

Examples of io.fabric8.process.manager.InstallOptions

        String firstVmOption = "-Dfoo=bar";
        String secondVmOption = "-Dbaz=qux";
        javaContainerConfig.setJvmArguments(firstVmOption + " " + secondVmOption);

        // When
        InstallOptions installOptions = managerController.createJavaInstallOptions(container, containerMetadata, containerOptions, javaContainerConfig, new HashMap<String, String>());

        // Then
        assertArrayEquals(new String[]{firstVmOption, secondVmOption}, installOptions.getJvmOptions());
    }
View Full Code Here

Examples of io.fabric8.process.manager.InstallOptions

    @Before
    public void setUp() throws Exception {
        System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");

        InstallOptions installOptions = new InstallOptions.InstallOptionsBuilder().build();
        String processId = new ProcessManagerService(installDir).installJar(installOptions, postInstall).getId();
        controller = new DefaultProcessController(processId, new ProcessConfig(), installDir, new File(installDir, processId));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.