< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/AbstractLauncher.java

Print this page

 38 import com.sun.jdi.VirtualMachineManager;
 39 import com.sun.jdi.connect.Connector;
 40 import com.sun.jdi.connect.IllegalConnectorArgumentsException;
 41 import com.sun.jdi.connect.LaunchingConnector;
 42 import com.sun.jdi.connect.VMStartException;
 43 import com.sun.jdi.connect.spi.Connection;
 44 import com.sun.jdi.connect.spi.TransportService;
 45 
 46 abstract class AbstractLauncher extends ConnectorImpl
 47                                 implements LaunchingConnector
 48 {
 49     public abstract VirtualMachine
 50         launch(Map<String, ? extends Connector.Argument> arguments)
 51         throws IOException, IllegalConnectorArgumentsException,
 52                VMStartException;
 53 
 54     public abstract String name();
 55 
 56     public abstract String description();
 57 
 58     ThreadGroup grp;
 59 
 60     AbstractLauncher() {
 61         super();
 62 
 63         grp = Thread.currentThread().getThreadGroup();

 64         ThreadGroup parent = null;
 65         while ((parent = grp.getParent()) != null) {
 66             grp = parent;
 67         }

 68     }
 69 
 70     String[] tokenizeCommand(String command, char quote) {
 71         String quoteStr = String.valueOf(quote); // easier to deal with
 72 
 73         /*
 74          * Tokenize the command, respecting the given quote character.
 75          */
 76         StringTokenizer tokenizer = new StringTokenizer(command,
 77                                                         quote + " \t\r\n\f",
 78                                                         true);
 79         String quoted = null;
 80         String pending = null;
 81         List<String> tokenList = new ArrayList<>();
 82         while (tokenizer.hasMoreTokens()) {
 83             String token = tokenizer.nextToken();
 84             if (quoted != null) {
 85                 if (token.equals(quoteStr)) {
 86                     tokenList.add(quoted);
 87                     quoted = null;

 38 import com.sun.jdi.VirtualMachineManager;
 39 import com.sun.jdi.connect.Connector;
 40 import com.sun.jdi.connect.IllegalConnectorArgumentsException;
 41 import com.sun.jdi.connect.LaunchingConnector;
 42 import com.sun.jdi.connect.VMStartException;
 43 import com.sun.jdi.connect.spi.Connection;
 44 import com.sun.jdi.connect.spi.TransportService;
 45 
 46 abstract class AbstractLauncher extends ConnectorImpl
 47                                 implements LaunchingConnector
 48 {
 49     public abstract VirtualMachine
 50         launch(Map<String, ? extends Connector.Argument> arguments)
 51         throws IOException, IllegalConnectorArgumentsException,
 52                VMStartException;
 53 
 54     public abstract String name();
 55 
 56     public abstract String description();
 57 
 58     final ThreadGroup grp;
 59 
 60     AbstractLauncher() {
 61         super();
 62 
 63         @SuppressWarnings("deprecation")
 64         ThreadGroup g = Thread.currentThread().getThreadGroup();
 65         ThreadGroup parent = null;
 66         while ((parent = g.getParent()) != null) {
 67             g = parent;
 68         }
 69         grp = g;
 70     }
 71 
 72     String[] tokenizeCommand(String command, char quote) {
 73         String quoteStr = String.valueOf(quote); // easier to deal with
 74 
 75         /*
 76          * Tokenize the command, respecting the given quote character.
 77          */
 78         StringTokenizer tokenizer = new StringTokenizer(command,
 79                                                         quote + " \t\r\n\f",
 80                                                         true);
 81         String quoted = null;
 82         String pending = null;
 83         List<String> tokenList = new ArrayList<>();
 84         while (tokenizer.hasMoreTokens()) {
 85             String token = tokenizer.nextToken();
 86             if (quoted != null) {
 87                 if (token.equals(quoteStr)) {
 88                     tokenList.add(quoted);
 89                     quoted = null;
< prev index next >