Package com.sun.enterprise.universal.process

Examples of com.sun.enterprise.universal.process.ProcessManager.execute()


        else
            pm.setEcho(false);
        int exit;

        try {
            exit = pm.execute();           
        }
        catch (ProcessManagerException ex) {
            logger.fine("Error while executing ssh-keygen: " + ex.getMessage());
            exit = 1;
        }
View Full Code Here


            pm.setEcho(false);
            pm.execute();

            pm = new ProcessManager(targetWin32Exe.getAbsolutePath(), "uninstall");
            pm.setEcho(false);
            pm.execute();

            trace("Uninstalled Windows Service");

            if (!targetWin32Exe.delete())
                targetWin32Exe.deleteOnExit();
View Full Code Here

        if (info.dryRun || !targetWin32Exe.canExecute())
            return 0;
        // it is NOT an error to not be able to uninstall
        ProcessManager mgr = new ProcessManager(targetWin32Exe.getPath(), "uninstall");
        mgr.setEcho(false);
        mgr.execute();
        trace("Uninstall STDERR: " + mgr.getStderr());
        trace("Uninstall STDOUT: " + mgr.getStdout());
        return mgr.getExitValue();
    }
View Full Code Here

                dryRun("Dry Run error: delete failed for targetXml " + targetXml);
        }
        else {
            ProcessManager mgr = new ProcessManager(targetWin32Exe.getPath(), "install");
            mgr.setEcho(false);
            mgr.execute();
            int ret = mgr.getExitValue();

            if (ret != 0)
                throw new RuntimeException(Strings.get("windows.services.install.bad",
                        "" + ret, mgr.getStdout(), mgr.getStderr()));
View Full Code Here

    private void createLink(File link, String[] cmds) {
        try {
            ProcessManager mgr = new ProcessManager(cmds);
            mgr.setEcho(false);
            mgr.execute();
            trace("Create Link Output: " + mgr.getStdout() + mgr.getStderr());
            link.setExecutable(true, false);
            trace("Created link file: " + link);
        }
        catch (ProcessManagerException e) {
View Full Code Here

            if (!targetWin32Exe.canExecute())
                throw new RuntimeException(Strings.get("cant_exec"));

            ProcessManager pm = new ProcessManager(targetWin32Exe.getAbsolutePath(), "stop");
            pm.setEcho(false);
            pm.execute();

            pm = new ProcessManager(targetWin32Exe.getAbsolutePath(), "uninstall");
            pm.setEcho(false);
            pm.execute();
View Full Code Here

            StringBuilder sb = new StringBuilder();
            if (!isUserSmfAuthorized(me, sb))
                throw new RuntimeException(Strings.get("noSmfAuth", me, sb.toString()));
            ProcessManager pm = new ProcessManager(SVCADM, "disable", info.serviceName);
            pm.setEcho(false);
            pm.execute();
            pm = new ProcessManager(SVCCFG, "delete", info.serviceName);
            pm.setEcho(false);
            pm.execute();
        }
        catch (RuntimeException re) {
View Full Code Here

            ProcessManager pm = new ProcessManager(SVCADM, "disable", info.serviceName);
            pm.setEcho(false);
            pm.execute();
            pm = new ProcessManager(SVCCFG, "delete", info.serviceName);
            pm.setEcho(false);
            pm.execute();
        }
        catch (RuntimeException re) {
            throw re;
        }
        catch (Exception ex) {
View Full Code Here

        pm.setEnvironment(envp);

        int exit;
        String myErr = "";
        try {
            exit = pm.execute();
        }
        catch (ProcessManagerTimeoutException tex) {
            myErr = "\nProcessManagerTimeoutException: command timed out after " + timeout + " ms.";
            exit = 1;
        }
View Full Code Here

            pm.setEnvironment(envp);

            int exit;
            String myErr = "";
            try {
                exit = pm.execute();
            }
            catch (ProcessManagerTimeoutException tex) {
                myErr = "\nProcessManagerTimeoutException: command timed out after " + timeout + " ms.";
                exit = 1;
            }
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.