Java Code Examples for java.lang.Process#destroy()

The following examples show how to use java.lang.Process#destroy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: derbyrunjartest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
private static void runtool(jvm jvm, String loc, String[] args)
    throws IOException
{
    System.out.println(concatenate(args) + ':');

    if (jvm == null) {
        com.pivotal.gemfirexd.internal.iapi.tools.run.main(args);
        return;
    }

    Vector cmd = jvm.getCommandLine();
    cmd.addElement("-jar");
    cmd.addElement(loc);
    for (int i=0; i < args.length; i++) {
        cmd.addElement(args[i]);
    }
    String command = concatenate((String[]) cmd.toArray(new String[0]));

    Process pr = null;

    try
    {
        pr = Runtime.getRuntime().exec(command);
        BackgroundStreamSaver saver = 
                    new BackgroundStreamSaver(pr.getInputStream(), System.out);
        saver.finish();
        pr.waitFor();
        pr.destroy();
    } catch(Throwable t) {
        System.out.println("Process exception: " + t.getMessage());
        if (pr != null)
        {
            pr.destroy();
            pr = null;
        }
    }
}
 
Example 2
Source File: Activation.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 3
Source File: Activation.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 4
Source File: Activation.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 5
Source File: Activation.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 6
Source File: Activation.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 7
Source File: Activation.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 8
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 9
Source File: Activation.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 10
Source File: Activation.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 11
Source File: derbyrunjartest.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
private static void runtool(jvm jvm, String loc, String[] args)
    throws IOException
{
    System.out.println(concatenate(args) + ':');

    if (jvm == null) {
        com.pivotal.gemfirexd.internal.iapi.tools.run.main(args);
        return;
    }

    Vector cmd = jvm.getCommandLine();
    cmd.addElement("-jar");
    cmd.addElement(loc);
    for (int i=0; i < args.length; i++) {
        cmd.addElement(args[i]);
    }
    String command = concatenate((String[]) cmd.toArray(new String[0]));

    Process pr = null;

    try
    {
        pr = Runtime.getRuntime().exec(command);
        BackgroundStreamSaver saver = 
                    new BackgroundStreamSaver(pr.getInputStream(), System.out);
        saver.finish();
        pr.waitFor();
        pr.destroy();
    } catch(Throwable t) {
        System.out.println("Process exception: " + t.getMessage());
        if (pr != null)
        {
            pr.destroy();
            pr = null;
        }
    }
}
 
Example 12
Source File: Activation.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 13
Source File: Activation.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 14
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}
 
Example 15
Source File: Activation.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
void shutdownFast() {
    Process p = child;
    if (p != null) {
        p.destroy();
    }
}