Search in sources :

Example 6 with ProcessExecutor

use of com.sun.enterprise.util.ProcessExecutor in project Payara by payara.

the class MyDBPlugin method start.

public void start(VirtualMachine virtualMachine, boolean firstStart) {
    String[] startdbArgs = { serverContext.getInstallRoot().getAbsolutePath() + File.separator + "bin" + File.separator + "asadmin" + (OS.isWindows() ? ".bat" : ""), "start-database", "--dbport", "1528" };
    ProcessExecutor startDatabase = new ProcessExecutor(startdbArgs);
    try {
        startDatabase.execute();
    } catch (ExecException e) {
        e.printStackTrace();
    }
}
Also used : ExecException(com.sun.enterprise.util.ExecException) ProcessExecutor(com.sun.enterprise.util.ProcessExecutor)

Example 7 with ProcessExecutor

use of com.sun.enterprise.util.ProcessExecutor in project Payara by payara.

the class MyDBPlugin method stop.

public void stop(VirtualMachine virtualMachine) {
    String[] stopdbArgs = { serverContext.getInstallRoot().getAbsolutePath() + File.separator + "bin" + File.separator + "asadmin" + (OS.isWindows() ? ".bat" : ""), "stop-database", "--dbport", "1528" };
    ProcessExecutor stopDatabase = new ProcessExecutor(stopdbArgs);
    try {
        stopDatabase.execute();
    } catch (ExecException e) {
        e.printStackTrace();
    }
}
Also used : ExecException(com.sun.enterprise.util.ExecException) ProcessExecutor(com.sun.enterprise.util.ProcessExecutor)

Example 8 with ProcessExecutor

use of com.sun.enterprise.util.ProcessExecutor in project Payara by payara.

the class SMFService method validateService.

private void validateService() throws Exception {
    final String[] cmda = new String[] { SMFService.SVCCFG, "validate", getManifestFilePath() };
    final ProcessExecutor pe = new ProcessExecutor(cmda);
    pe.execute();
    if (info.trace)
        printOut("Validated the SMF Service: " + info.fqsn + " using: " + SMFService.SVCCFG);
}
Also used : ProcessExecutor(com.sun.enterprise.util.ProcessExecutor)

Aggregations

ProcessExecutor (com.sun.enterprise.util.ProcessExecutor)8 ExecException (com.sun.enterprise.util.ExecException)4 ProcessManagerException (com.sun.enterprise.universal.process.ProcessManagerException)2 File (java.io.File)2 PrintStream (java.io.PrintStream)2 ServiceLocator (org.glassfish.hk2.api.ServiceLocator)2 ServerContext (org.glassfish.internal.api.ServerContext)2 Test (org.junit.Test)2 StringTokenizer (java.util.StringTokenizer)1 CommandResult (org.glassfish.embeddable.CommandResult)1 CommandRunner (org.glassfish.embeddable.CommandRunner)1 Deployer (org.glassfish.embeddable.Deployer)1 GlassFish (org.glassfish.embeddable.GlassFish)1 GlassFishProperties (org.glassfish.embeddable.GlassFishProperties)1