jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1998-2004 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.jdi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.jdi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import com.sun.jdi.connect.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import com.sun.jdi.connect.spi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import com.sun.jdi.VirtualMachine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.util.HashMap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.util.Random;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.io.File;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
public class SunCommandLineLauncher extends AbstractLauncher implements LaunchingConnector {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    static private final String ARG_HOME = "home";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    static private final String ARG_OPTIONS = "options";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    static private final String ARG_MAIN = "main";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    static private final String ARG_INIT_SUSPEND = "suspend";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    static private final String ARG_QUOTE = "quote";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    static private final String ARG_VM_EXEC = "vmexec";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    TransportService transportService;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    Transport transport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    boolean usingSharedMemory = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    TransportService transportService() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        return transportService;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    public Transport transport() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        return transport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    public SunCommandLineLauncher() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
         * By default this connector uses either the shared memory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
         * transport or the socket transport
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            Class c = Class.forName("com.sun.tools.jdi.SharedMemoryTransportService");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
            transportService = (TransportService)c.newInstance();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            transport = new Transport() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                public String name() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                    return "dt_shmem";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            usingSharedMemory = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        } catch (ClassNotFoundException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        } catch (UnsatisfiedLinkError x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        } catch (InstantiationException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        } catch (IllegalAccessException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        if (transportService == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
            transportService = new SocketTransportService();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            transport = new Transport() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                public String name() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                    return "dt_socket";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                ARG_HOME,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                getString("sun.home.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                getString("sun.home"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                System.getProperty("java.home"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
                ARG_OPTIONS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                getString("sun.options.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
                getString("sun.options"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                ARG_MAIN,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                getString("sun.main.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                getString("sun.main"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                "",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        addBooleanArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                ARG_INIT_SUSPEND,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                getString("sun.init_suspend.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                getString("sun.init_suspend"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                true,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                ARG_QUOTE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                getString("sun.quote.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                getString("sun.quote"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                "\"",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        addStringArgument(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                ARG_VM_EXEC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                getString("sun.vm_exec.label"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                getString("sun.vm_exec"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                "java",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    static boolean hasWhitespace(String string) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        int length = string.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        for (int i = 0; i < length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            if (Character.isWhitespace(string.charAt(i))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    public VirtualMachine
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        launch(Map<String,? extends Connector.Argument> arguments)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        throws IOException, IllegalConnectorArgumentsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
               VMStartException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        VirtualMachine vm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        String home = argument(ARG_HOME, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        String options = argument(ARG_OPTIONS, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        String mainClassAndArgs = argument(ARG_MAIN, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        boolean wait = ((BooleanArgumentImpl)argument(ARG_INIT_SUSPEND,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                                                  arguments)).booleanValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        String quote = argument(ARG_QUOTE, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        String exe = argument(ARG_VM_EXEC, arguments).value();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        String exePath = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        if (quote.length() > 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            throw new IllegalConnectorArgumentsException("Invalid length",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                                                         ARG_QUOTE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        if ((options.indexOf("-Djava.compiler=") != -1) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            (options.toLowerCase().indexOf("-djava.compiler=none") == -1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            throw new IllegalConnectorArgumentsException("Cannot debug with a JIT compiler",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                                                         ARG_OPTIONS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
         * Start listening.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
         * If we're using the shared memory transport then we pick a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
         * random address rather than using the (fixed) default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
         * Random() uses System.currentTimeMillis() as the seed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
         * which can be a problem on windows (many calls to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
         * currentTimeMillis can return the same value), so
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
         * we do a few retries if we get an IOException (we
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
         * assume the IOException is the filename is already in use.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        TransportService.ListenKey listenKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        if (usingSharedMemory) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            Random rr = new Random();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            int failCount = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            while(true) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                    String address = "javadebug" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                        String.valueOf(rr.nextInt(100000));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                    listenKey = transportService().startListening(address);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                } catch (IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                    if (++failCount > 5) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                        throw ioe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            listenKey = transportService().startListening();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        String address = listenKey.address();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            if (home.length() > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                 * A wrinkle in the environment:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                 * 64-bit executables are stored under $JAVA_HOME/bin/os_arch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                 * 32-bit executables are stored under $JAVA_HOME/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                String os_arch = System.getProperty("os.arch");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                if ("SunOS".equals(System.getProperty("os.name")) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                   ("sparcv9".equals(os_arch) || "amd64".equals(os_arch))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                    exePath = home + File.separator + "bin" + File.separator +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                        os_arch + File.separator + exe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                    exePath = home + File.separator + "bin" + File.separator + exe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                exePath = exe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            // Quote only if necessary in case the quote arg value is bogus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            if (hasWhitespace(exe)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                exePath = quote + exePath + quote;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            String xrun = "transport=" + transport().name() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                          ",address=" + address +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                          ",suspend=" + (wait? 'y' : 'n');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            // Quote only if necessary in case the quote arg value is bogus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            if (hasWhitespace(xrun)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                xrun = quote + xrun + quote;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
            String command = exePath + ' ' +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                             options + ' ' +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                             "-Xdebug " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                             "-Xrunjdwp:" + xrun + ' ' +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                             mainClassAndArgs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
            // System.err.println("Command: \"" + command + '"');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            vm = launch(tokenizeCommand(command, quote.charAt(0)), address, listenKey,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                        transportService());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
            transportService().stopListening(listenKey);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        return vm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public String name() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        return "com.sun.jdi.CommandLineLaunch";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    public String description() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        return getString("sun.description");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
}