Java 类com.sun.jdi.connect.spi.TransportService 实例源码

项目:openjdk-jdk10    文件:SocketTransportService.java   
/**
 * Return the capabilities of this transport service
 */
public Capabilities capabilities() {
    return new TransportService.Capabilities() {
        public boolean supportsMultipleConnections() {
            return true;
        }

        public boolean supportsAttachTimeout() {
            return true;
        }

        public boolean supportsAcceptTimeout() {
            return true;
        }

        public boolean supportsHandshakeTimeout() {
            return true;
        }
    };
}
项目: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);
    }
}
项目:intellij-ce-playground    文件:TransportServiceWrapper.java   
public static TransportServiceWrapper getTransportService(boolean forceSocketTransport) throws ExecutionException {
  TransportServiceWrapper transport;
  try {
    try {
      if (forceSocketTransport) {
        transport = new TransportServiceWrapper((Class<? extends TransportService>)Class.forName(SOCKET_TRANSPORT_CLASS));
      }
      else {
        transport = new TransportServiceWrapper((Class<? extends TransportService>)Class.forName(SHMEM_TRANSPORT_CLASS));
      }
    }
    catch (UnsatisfiedLinkError ignored) {
      transport = new TransportServiceWrapper((Class<? extends TransportService>)Class.forName(SOCKET_TRANSPORT_CLASS));
    }
  }
  catch (Exception e) {
    throw new ExecutionException(e.getClass().getName() + " : " + e.getMessage());
  }
  return transport;
}
项目:jdk8u-jdk    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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   
Helper(String[] commandArray, String address, TransportService.ListenKey listenKey,
    TransportService ts) {
    this.commandArray = commandArray;
    this.address = address;
    this.listenKey = listenKey;
    this.ts = ts;
}
项目:openjdk-jdk10    文件:GenericListeningConnector.java   
/**
 * Initialize a new instance of this connector. The connector
 * encapsulates a transport service, has a "timeout" connector argument,
 * and optionally an "address" connector argument.
 */
private GenericListeningConnector(TransportService ts,
                                  boolean addAddressArgument)
{
    transportService = ts;
    transport = new Transport() {
            public String name() {
                return transportService.name();
            }
        };

    if (addAddressArgument) {
        addStringArgument(
            ARG_ADDRESS,
            getString("generic_listening.address.label"),
            getString("generic_listening.address"),
            "",
            false);
    }

    addIntegerArgument(
            ARG_TIMEOUT,
            getString("generic_listening.timeout.label"),
            getString("generic_listening.timeout"),
            "",
            false,
            0, Integer.MAX_VALUE);

    listenMap = new HashMap<Map<String, ? extends Connector.Argument>, TransportService.ListenKey>(10);
}
项目:openjdk-jdk10    文件:GenericListeningConnector.java   
public String startListening(String address, Map<String,? extends Connector.Argument> args)
    throws IOException, IllegalConnectorArgumentsException
{
    TransportService.ListenKey listener = listenMap.get(args);
    if (listener != null) {
       throw new IllegalConnectorArgumentsException("Already listening",
           new ArrayList<>(args.keySet()));
    }

    listener = transportService.startListening(address);
    listenMap.put(args, listener);
    return listener.address();
}
项目:openjdk-jdk10    文件:GenericListeningConnector.java   
public void stopListening(Map<String, ? extends Connector.Argument> args)
    throws IOException, IllegalConnectorArgumentsException
{
    TransportService.ListenKey listener = listenMap.get(args);
    if (listener == null) {
       throw new IllegalConnectorArgumentsException("Not listening",
           new ArrayList<>(args.keySet()));
    }
    transportService.stopListening(listener);
    listenMap.remove(args);
}
项目:openjdk-jdk10    文件:GenericAttachingConnector.java   
private GenericAttachingConnector(TransportService ts,
                                  boolean addAddressArgument)
{
    transportService = ts;
    transport = new Transport() {
        public String name() {
            // delegate name to the transport service
            return transportService.name();
        }
    };

    if (addAddressArgument) {
        addStringArgument(
            ARG_ADDRESS,
            getString("generic_attaching.address.label"),
            getString("generic_attaching.address"),
            "",
            true);
    }

    addIntegerArgument(
            ARG_TIMEOUT,
            getString("generic_attaching.timeout.label"),
            getString("generic_attaching.timeout"),
            "",
            false,
            0, Integer.MAX_VALUE);
}
项目:openjdk-jdk10    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class<?> c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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 SimpleLaunchingConnector() {
    try {
        Class<?> c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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 SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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 SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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);
}
项目:intellij-ce-playground    文件:TransportServiceWrapper.java   
private TransportServiceWrapper(Class<? extends TransportService> delegateClass) throws NoSuchMethodException,
                                                    IllegalAccessException,
                                                    InvocationTargetException,
                                                    InstantiationException {
  myDelegateClass = delegateClass;
  final Constructor constructor = delegateClass.getDeclaredConstructor(ArrayUtil.EMPTY_CLASS_ARRAY);
  constructor.setAccessible(true);
  myTransport = (TransportService)constructor.newInstance(ArrayUtil.EMPTY_OBJECT_ARRAY);
}
项目:infobip-open-jdk-8    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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 SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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);
}
项目:jdk7-jdk    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目:openjdk-source-code-learn    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目:OLD-OpenJDK8    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目: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);
}
项目:JAVA_UNIT    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目:openjdk-jdk7u-jdk    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目:openjdk-icedtea7    文件:SimpleLaunchingConnector.java   
public SimpleLaunchingConnector() {
    try {
        Class c = Class.forName("com.sun.tools.jdi.SocketTransportService");
        ts = (TransportService)c.newInstance();
    } catch (Exception x) {
        throw new Error(x);
    }
}
项目:openjdk-jdk10    文件:RawCommandLineLauncher.java   
public TransportService transportService() {
    return transportService;
}
项目:openjdk-jdk10    文件:SunCommandLineLauncher.java   
TransportService transportService() {
    return transportService;
}
项目:openjdk-jdk10    文件:GenericAttachingConnector.java   
public static GenericAttachingConnector create(TransportService ts) {
    return new GenericAttachingConnector(ts, true);
}
项目:intellij-ce-playground    文件:TransportServiceWrapper.java   
public TransportService.ListenKey startListening() throws IOException {
  return myTransport.startListening();
}
项目:intellij-ce-playground    文件:TransportServiceWrapper.java   
public TransportService.ListenKey startListening(String address) throws IOException {
  return myTransport.startListening(address);
}
项目:intellij-ce-playground    文件:TransportServiceWrapper.java   
public void stopListening(final TransportService.ListenKey address) throws IOException {
  myTransport.stopListening(address);
}
项目: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);
}