Java 类com.sun.jdi.connect.VMStartException 实例源码

项目:OpenJSharp    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:jdk8u-jdk    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:openjdk-jdk10    文件:RawCommandLineLauncher.java   
public VirtualMachine
    launch(Map<String, ? extends Connector.Argument> arguments)
    throws IOException, IllegalConnectorArgumentsException,
           VMStartException
{
    String command = argument(ARG_COMMAND, arguments).value();
    String address = argument(ARG_ADDRESS, arguments).value();
    String quote = argument(ARG_QUOTE, arguments).value();

    if (quote.length() > 1) {
        throw new IllegalConnectorArgumentsException("Invalid length",
                                                     ARG_QUOTE);
    }

    TransportService.ListenKey listener = transportService.startListening(address);

    try {
        return launch(tokenizeCommand(command, quote.charAt(0)),
                      address, listener, transportService);
    } finally {
        transportService.stopListening(listener);
    }
}
项目:java-debug    文件:DebugUtility.java   
/**
 * Launch a debuggee in suspend mode.
 * @see {@link #launch(VirtualMachineManager, String, String, String, String, String)}
 */
public static IDebugSession launch(VirtualMachineManager vmManager,
        String mainClass,
        String programArguments,
        String vmArguments,
        List<String> modulePaths,
        List<String> classPaths,
        String cwd,
        String[] envVars)
        throws IOException, IllegalConnectorArgumentsException, VMStartException {
    return DebugUtility.launch(vmManager,
            mainClass,
            programArguments,
            vmArguments,
            String.join(File.pathSeparator, modulePaths),
            String.join(File.pathSeparator, classPaths),
            cwd,
            envVars);
}
项目:jdk8u_jdk    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:lookaside_java-1.8.0-openjdk    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:infobip-open-jdk-8    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:jdk8u-dev-jdk    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:jdk7-jdk    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:openjdk-source-code-learn    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:OLD-OpenJDK8    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:openjdk-jdk7u-jdk    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:openjdk-icedtea7    文件:ChildSession.java   
static private VirtualMachine generalGetVM(OutputListener diagnostics,
                                           LaunchingConnector connector,
                                           Map<String, Connector.Argument> arguments) {
    VirtualMachine vm = null;
    try {
        diagnostics.putString("Starting child.");
        vm = connector.launch(arguments);
    } catch (IOException ioe) {
        diagnostics.putString("Unable to start child: " + ioe.getMessage());
    } catch (IllegalConnectorArgumentsException icae) {
        diagnostics.putString("Unable to start child: " + icae.getMessage());
    } catch (VMStartException vmse) {
        diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
        dumpFailedLaunchInfo(diagnostics, vmse.process());
    }
    return vm;
}
项目:jdk8u-jdk    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:openjdk-jdk10    文件:AbstractLauncher.java   
protected VirtualMachine launch(String[] commandArray, String address,
                                TransportService.ListenKey listenKey,
                                TransportService ts)
                                throws IOException, VMStartException {
    Helper helper = new Helper(commandArray, address, listenKey, ts);
    helper.launchAndAccept();

    VirtualMachineManager manager =
        Bootstrap.virtualMachineManager();

    return manager.createVirtualMachine(helper.connection(),
                                        helper.process());
}
项目:openjdk-jdk10    文件:AbstractLauncher.java   
synchronized void launchAndAccept() throws
                        IOException, VMStartException {

    process = Runtime.getRuntime().exec(commandArray);

    Thread acceptingThread = acceptConnection();
    Thread monitoringThread = monitorTarget();
    try {
        while ((connection == null) &&
               (acceptException == null) &&
               !exited) {
            wait();
        }

        if (exited) {
            throw new VMStartException(
                "VM initialization failed for: " + commandString(), process);
        }
        if (acceptException != null) {
            // Rethrow the exception in this thread
            throw acceptException;
        }
    } catch (InterruptedException e) {
        throw new InterruptedIOException("Interrupted during accept");
    } finally {
        acceptingThread.interrupt();
        monitoringThread.interrupt();
    }
}
项目:openjdk-jdk10    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:openjdk9    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:jdk8u_jdk    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:lookaside_java-1.8.0-openjdk    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:infobip-open-jdk-8    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:jdk8u-dev-jdk    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:jink    文件:Session.java   
private VirtualMachine spawn( String vmArgs, String cmdLine ) throws SessionException
{
    VirtualMachine vm;

       try
       {
        VirtualMachineManager manager = Bootstrap.virtualMachineManager();

        LaunchingConnector connector = manager.defaultConnector();

        Map arguments = connector.defaultArguments();
        DC.log(LEVEL, arguments );
        ((Connector.Argument)arguments.get("options")).setValue(vmArgs);
        ((Connector.Argument)arguments.get("main")).setValue(cmdLine);

           vm = connector.launch( arguments );
           return vm;
       }
       catch (IOException ioe)
       {
        throw new SessionException( ioe );
       }
       catch (IllegalConnectorArgumentsException icae )
       {
        throw new SessionException( icae );
       }
       catch (VMStartException vmse )
       {
        throw new SessionException( vmse );
       }
}
项目:OLD-OpenJDK8    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator + "java";
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:openjdk-jdk10    文件:AbstractLauncher.java   
abstract public VirtualMachine
launch(Map<String, ? extends Connector.Argument> arguments)
throws IOException, IllegalConnectorArgumentsException,
       VMStartException;
项目:form-follows-function    文件:F3RawLaunchingConnector.java   
public F3VirtualMachine launch(Map<String, ? extends Argument> args)
        throws IOException, IllegalConnectorArgumentsException, VMStartException {
    return F3Wrapper.wrap(underlying().launch(args));
}
项目:form-follows-function    文件:F3LaunchingConnector.java   
public F3VirtualMachine launch(Map<String, ? extends Argument> args)
        throws IOException, IllegalConnectorArgumentsException, VMStartException {
    return F3Wrapper.wrap(underlying().launch(args));
}
项目:jdk7-jdk    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator;
    String arch = System.getProperty("os.arch");
    String osname = System.getProperty("os.name");
    if (osname.equals("SunOS") && arch.equals("sparcv9")) {
        exe += "sparcv9/java";
    } else if (osname.equals("SunOS") && arch.equals("amd64")) {
        exe += "amd64/java";
    } else {
        exe += "java";
    }
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:openjdk-source-code-learn    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator;
    String arch = System.getProperty("os.arch");
    String osname = System.getProperty("os.name");
    if (osname.equals("SunOS") && arch.equals("sparcv9")) {
        exe += "sparcv9/java";
    } else if (osname.equals("SunOS") && arch.equals("amd64")) {
        exe += "amd64/java";
    } else {
        exe += "java";
    }
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:JAVA_UNIT    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator;
    String arch = System.getProperty("os.arch");
    String osname = System.getProperty("os.name");
    if (osname.equals("SunOS") && arch.equals("sparcv9")) {
        exe += "sparcv9/java";
    } else if (osname.equals("SunOS") && arch.equals("amd64")) {
        exe += "amd64/java";
    } else {
        exe += "java";
    }
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:openjdk-jdk7u-jdk    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator;
    String arch = System.getProperty("os.arch");
    String osname = System.getProperty("os.name");
    if (osname.equals("SunOS") && arch.equals("sparcv9")) {
        exe += "sparcv9/java";
    } else if (osname.equals("SunOS") && arch.equals("amd64")) {
        exe += "amd64/java";
    } else {
        exe += "java";
    }
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:openjdk-icedtea7    文件:SimpleLaunchingConnector.java   
public VirtualMachine launch(Map<String, ? extends Connector.Argument> arguments) throws
                          IOException,
                          IllegalConnectorArgumentsException,
                          VMStartException {

    /*
     * Get the class name that we are to execute
     */
    String className = ((StringArgumentImpl)arguments.get(ARG_NAME)).value();
    if (className.length() == 0) {
        throw new IllegalConnectorArgumentsException("class name missing", ARG_NAME);
    }

    /*
     * Listen on an emperical port; launch the debuggee; wait for
     * for the debuggee to connect; stop listening;
     */
    TransportService.ListenKey key = ts.startListening();

    String exe = System.getProperty("java.home") + File.separator + "bin" +
        File.separator;
    String arch = System.getProperty("os.arch");
    String osname = System.getProperty("os.name");
    if (osname.equals("SunOS") && arch.equals("sparcv9")) {
        exe += "sparcv9/java";
    } else if (osname.equals("SunOS") && arch.equals("amd64")) {
        exe += "amd64/java";
    } else {
        exe += "java";
    }
    String cmd = exe + " -Xdebug -Xrunjdwp:transport=dt_socket,timeout=15000,address=" +
        key.address() +
        " -classpath " + System.getProperty("test.classes") +
        " " + className;
    Process process = Runtime.getRuntime().exec(cmd);
    Connection conn = ts.accept(key, 30*1000, 9*1000);
    ts.stopListening(key);

    /*
     * Debugee is connected - return the virtual machine mirror
     */
    return Bootstrap.virtualMachineManager().createVirtualMachine(conn);
}
项目:incubator-netbeans    文件:LaunchingDICookie.java   
/**
 * Creates a new instance of VirtualMachine for this DebuggerInfo Cookie.
 *
 * @return a new instance of VirtualMachine for this DebuggerInfo Cookie
 */
public VirtualMachine getVirtualMachine () throws IOException,
IllegalConnectorArgumentsException, VMStartException {
    return launchingConnector.launch (args);
}
项目:incubator-netbeans    文件:AbstractDICookie.java   
/**
 * Creates a new instance of VirtualMachine for this DebuggerInfo Cookie.
 *
 * @return a new instance of VirtualMachine for this DebuggerInfo Cookie
 * @throws java.net.ConnectException When a connection is refused
 */
public abstract VirtualMachine getVirtualMachine () throws IOException,
IllegalConnectorArgumentsException, VMStartException;