Search in sources :

Example 1 with WindowsWmi

use of com.sun.enterprise.util.cluster.windows.process.WindowsWmi in project Payara by payara.

the class ValidateDcom method testWMI.

private boolean testWMI() {
    int count = -1;
    try {
        WindowsWmi ww = new WindowsWmi(creds);
        count = ww.getCount();
        if (debug) {
            String[] info = ww.getInfo();
            out.append(Strings.get("dcom.wmi.procinfolegend"));
            for (String s : info) {
                // e.g. '\tCommandLine = "xxxxx"'
                String[] lines = s.split("[\t\n\r]");
                for (String line : lines) {
                    if (line.startsWith("CommandLine")) {
                        out.append("    ").append(line).append('\n');
                        break;
                    }
                }
            }
        }
    } catch (WindowsException ex) {
        setError(ex, Strings.get("dcom.no.wmi", host));
        return false;
    }
    out.append(Strings.get("dcom.wmi.ok", host, count)).append('\n');
    return true;
}
Also used : WindowsWmi(com.sun.enterprise.util.cluster.windows.process.WindowsWmi) WindowsException(com.sun.enterprise.util.cluster.windows.process.WindowsException)

Aggregations

WindowsException (com.sun.enterprise.util.cluster.windows.process.WindowsException)1 WindowsWmi (com.sun.enterprise.util.cluster.windows.process.WindowsWmi)1