Package com.sun.enterprise.util

Examples of com.sun.enterprise.util.ProcessExecutor$RAFileReader


        else
            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


      throw new IllegalArgumentException();
    }
    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

      throw new IllegalArgumentException();
    }
    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

              path2Auths = System.getProperty("PATH_2_AUTHS");
          if (System.getProperty("AUTH_TOKEN") != null)
              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)
                      t = t.trim();
                  if (AUTH1.equals(t) || AUTH2.equals(t) || AUTH3.equals(t)) {
View Full Code Here

   
    private boolean serviceNameExists(final String sn) {
        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

        return ( tvset );
    }
   
    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);
    }
View Full Code Here

        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()};
        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 );
    }
View Full Code Here

            final List cmdInput = new ArrayList();
            cmdInput.add(broker.getAbsolutePath());
            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

                                                      "asupgrade", "-c", "-s",
                                                      domainDir+File.separator+domainName,
                                                      "-t", installDir +File.separator+ "domains",
                                                      "-noprompt" };
               
                ProcessExecutor pe = new ProcessExecutor(upgradeCmd, UPGRADE_TIMEOUT);
                /*
                 * ProcessExecutor's constructor replaces all the '/'s with '\' in case the OS is Windows.
                 * We don't want that for CMD /c. Hence need to replace it again
                 */
                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 {
                    CLILogger.getInstance().printDetailMessage((getLocalizedString("UpgradeSuccessful")));
View Full Code Here

TOP

Related Classes of com.sun.enterprise.util.ProcessExecutor$RAFileReader

Copyright © 2018 www.massapicom. 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.