Package org.apache.karaf.jpm.impl

Examples of org.apache.karaf.jpm.impl.ProcessBuilderFactoryImpl


                        + " -Dkaraf.startLocalConsole=false"
                        + " -Dkaraf.startRemoteShell=true"
                        + " -classpath \"" + classpath.toString() + "\""
                        + " org.apache.karaf.main.Main";
                LOGGER.debug("Starting instance " + name + " with command: " + command);
                org.apache.karaf.jpm.Process process = new ProcessBuilderFactoryImpl().newBuilder()
                        .directory(new File(location))
                        .command(command)
                        .start();
                instance.pid = process.getPid();
                return null;
View Full Code Here


                if (instance.pid == 0) {
                    throw new IllegalStateException("Instance already stopped");
                }
                cleanShutdown(instance);
                if (instance.pid > 0) {
                    Process process = new ProcessBuilderFactoryImpl().newBuilder().attach(instance.pid);
                    process.destroy();
                }
                return null;
            }
        });
View Full Code Here

        });
    }

    private void checkPid(InstanceState instance) throws IOException {
        if (instance.pid != 0) {
            Process process = new ProcessBuilderFactoryImpl().newBuilder().attach(instance.pid);
            if (!process.isRunning()) {
                instance.pid = 0;
            }
        }
    }
View Full Code Here

        command.append(MainTest.class.getName());
        command.append(" ");
        command.append(60000);
        System.err.println("Executing: " + command.toString());

        ProcessBuilder builder = new ProcessBuilderFactoryImpl().newBuilder();
        org.apache.karaf.jpm.Process p = builder.command(command.toString()).start();
        assertNotNull(p);
        System.err.println("Process: " + p.getPid());
        assertNotNull(p.getPid());
        Thread.sleep(1000);
View Full Code Here

                        + " -Dkaraf.startLocalConsole=false"
                        + " -Dkaraf.startRemoteShell=true"
                        + " -classpath \"" + classpath.toString() + "\""
                        + " org.apache.karaf.main.Main";
                LOGGER.debug("Starting instance " + name + " with command: " + command);
                org.apache.karaf.jpm.Process process = new ProcessBuilderFactoryImpl().newBuilder()
                        .directory(new File(location))
                        .command(command)
                        .start();
                instance.pid = process.getPid();
                return null;
View Full Code Here

                if (instance.pid == 0) {
                    throw new IllegalStateException("Instance already stopped");
                }
                cleanShutdown(instance);
                if (instance.pid > 0) {
                    Process process = new ProcessBuilderFactoryImpl().newBuilder().attach(instance.pid);
                    process.destroy();
                }
                return null;
            }
        });
View Full Code Here

        });
    }

    private void checkPid(InstanceState instance) throws IOException {
        if (instance.pid != 0) {
            Process process = new ProcessBuilderFactoryImpl().newBuilder().attach(instance.pid);
            if (!process.isRunning()) {
                instance.pid = 0;
            }
        }
    }
View Full Code Here

        this.service = service;
        this.name = name;
        this.location = location;
        this.javaOpts = javaOpts;
        this.root = root;
        this.processBuilderFactory = new ProcessBuilderFactoryImpl();
    }
View Full Code Here

* Factory for process builders.
*/
public abstract class ProcessBuilderFactory {

    public static ProcessBuilderFactory newInstance() {
        return new ProcessBuilderFactoryImpl();
    }
View Full Code Here

                + " -Dkaraf.startLocalConsole=false"
                + " -Dkaraf.startRemoteShell=true"
                + " -classpath \"" + classpath.toString() + "\""
                + " org.apache.karaf.main.Main";
        LOGGER.debug("Starting instance " + name + " with command: " + command);
        Process process = new ProcessBuilderFactoryImpl().newBuilder()
                .directory(new File(location))
                .command(command)
                .start();
        instance.pid = process.getPid();
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.jpm.impl.ProcessBuilderFactoryImpl

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.