Package com.sun.enterprise.util

Examples of com.sun.enterprise.util.ProcessExecutor.execute()


            inputLines = new String[]{}; //to provoke stream closing
        //startCommand = startCommand + " " + instance.getID() + " " + INSTALL_ROOT;
        try {
            sLogger.log(Level.FINE, "general.exec_cmd", startCommand[0]);
      ProcessExecutor executor = new ProcessExecutor(startCommand, inputLines);
      executor.execute();
    }
                catch (ExecException ee) {
                    sLogger.log(Level.WARNING, "general.exec_cmd", ee);
                    throw new RuntimeException(Localizer.getValue(ExceptionType.SERVER_NO_START));
                }
View Full Code Here


    }
    String stopCommand[] = instance.getStopCommand();
    try {
            sLogger.log(Level.FINE, "general.exec_cmd", stopCommand[0]);
      ProcessExecutor executor = new ProcessExecutor(stopCommand);
      executor.execute();
    }
    catch (Exception e) {
      throw new ConfigException(e.getMessage());
    }
  }
View Full Code Here

    }
    String[] restartCommand = instance.getRestartCommand();
    try {
            sLogger.log(Level.FINE, "general.exec_cmd", restartCommand[0]);
      ProcessExecutor executor = new ProcessExecutor(restartCommand);
      executor.execute();
    }
    catch (Exception e) {
      throw new ConfigException(e.getMessage());
    }
  }
View Full Code Here

    String[] command = instance.getGetSecurityTokensCommand();
        String[] inputLines = null;
        try {
            sLogger.log(Level.FINE, "general.gettokens_cmd", command[0]);
      ProcessExecutor executor = new ProcessExecutor(command);
      return executor.execute(true);
    }
                catch (ExecException ee) {
                        throw new RuntimeException(Localizer.getValue(ExceptionType.NO_RECEIVE_TOKENS));
                }
    catch (Exception e) {
View Full Code Here

              at = System.getProperty("AUTH_TOKEN");
          try {
              final String[] cmd = new String[]{path2Auths, user};
              ProcessExecutor pe = new ProcessExecutor(cmd);
              pe.setExecutionRetentionFlag(true);
              pe.execute();
              auths.append(pe.getLastExecutionOutput());
              final StringTokenizer st = new StringTokenizer(pe.getLastExecutionOutput(), at);
              while (st.hasMoreTokens()) {
                  String t = st.nextToken();
                  if (t != null)
View Full Code Here

        boolean exists = false;
        try {
            final String[] cmd = new String[] {"/usr/bin/svcs", sn};
            ProcessExecutor pe = new ProcessExecutor(cmd);
            pe.setExecutionRetentionFlag(true);
            pe.execute();
            exists = true;
        } catch(final Exception e) {
            //returns a non-zero status -- the service does not exist, status is already set
        }
        return ( exists );
View Full Code Here

    }
   
    private void validateService(final SMFService smf) throws Exception {
        final String[] cmda = new String[]{SMFService.SVCCFG, "validate", smf.getManifestFilePath()};
        final ProcessExecutor pe = new ProcessExecutor(cmda);
        pe.execute();
        if (trace)
            printOut("Validated the SMF Service: " + smf.getFQSN() + " using: " + SMFService.SVCCFG);
    }
    private boolean importService(final SMFService smf) throws Exception {
        final String[] cmda = new String[]{SMFService.SVCCFG, "import", smf.getManifestFilePath()};
View Full Code Here

            printOut("Validated the SMF Service: " + smf.getFQSN() + " using: " + SMFService.SVCCFG);
    }
    private boolean importService(final SMFService smf) throws Exception {
        final String[] cmda = new String[]{SMFService.SVCCFG, "import", smf.getManifestFilePath()};
        final ProcessExecutor pe = new ProcessExecutor(cmda);
        pe.execute(); //throws ExecException in case of an error
        if (trace)
            printOut("Imported the SMF Service: " + smf.getFQSN());
        return ( true );
    }
    private void cleanupManifest(final SMFService smf) throws RuntimeException {
View Full Code Here

            cmdInput.add("-init");
            cmdInput.add("-varhome");
            cmdInput.add(mqVarHome.getAbsolutePath());
            ProcessExecutor pe = new ProcessExecutor
            ((String[])cmdInput.toArray(new String[cmdInput.size()]));
            pe.execute(false, false);
        } catch (Exception ioe) {
             /*
             Dont do anything.

             IMQ instance is created just to make sure that
View Full Code Here

                 */
                if(OS.isWindows())
                        upgradeCmd[1] ="/c";

                CLILogger.getInstance().printDetailMessage((getLocalizedString("StartingUpgrade")));
                pe.execute()// timeout in 600sec or 10min
                Process process = pe.getSubProcess();
                int exitValue = process.waitFor();
                if (exitValue != 0) {
                    throw new CommandException(getLocalizedString("UpgradeFailed"));
                }else {
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.