Java Code Examples for java.rmi.activation.ActivationGroupDesc#getCommandEnvironment()

The following examples show how to use java.rmi.activation.ActivationGroupDesc#getCommandEnvironment() . 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: Activation.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 2
Source File: Activation.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 3
Source File: Activation.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 4
Source File: Activation.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 5
Source File: Activation.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 6
Source File: Activation.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 7
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 8
Source File: Activation.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 9
Source File: Activation.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 10
Source File: Activation.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 11
Source File: Activation.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 12
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}
 
Example 13
Source File: Activation.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private String[] activationArgs(ActivationGroupDesc desc) {
    ActivationGroupDesc.CommandEnvironment cmdenv;
    cmdenv = desc.getCommandEnvironment();

    // argv is the literal command to exec
    List<String> argv = new ArrayList<>();

    // Command name/path
    argv.add((cmdenv != null && cmdenv.getCommandPath() != null)
                ? cmdenv.getCommandPath()
                : command[0]);

    // Group-specific command options
    if (cmdenv != null && cmdenv.getCommandOptions() != null) {
        argv.addAll(Arrays.asList(cmdenv.getCommandOptions()));
    }

    // Properties become -D parameters
    Properties props = desc.getPropertyOverrides();
    if (props != null) {
        for (Enumeration<?> p = props.propertyNames();
             p.hasMoreElements();)
        {
            String name = (String) p.nextElement();
            /* Note on quoting: it would be wrong
             * here, since argv will be passed to
             * Runtime.exec, which should not parse
             * arguments or split on whitespace.
             */
            argv.add("-D" + name + "=" + props.getProperty(name));
        }
    }

    /* Finally, rmid-global command options (e.g. -C options)
     * and the classname
     */
    for (int i = 1; i < command.length; i++) {
        argv.add(command[i]);
    }

    String[] realArgv = new String[argv.size()];
    System.arraycopy(argv.toArray(), 0, realArgv, 0, realArgv.length);

    return realArgv;
}