Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/share/jdwp/ArgumentHandler.java
41162 views
/*1* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package nsk.share.jdwp;2425import nsk.share.*;26import nsk.share.jpda.*;2728import java.io.*;29import java.util.*;3031/**32* Parser for JDWP test's specific command-line arguments.33* <p>34* <code>ArgumentHandler</code> handles JDWP test's specific35* arguments related to launching debugee VM using JDWP features36* in addition to general arguments recognized by37* <code>DebugeeArgumentHandler</code> and <code>ArgumentParser</code>.38* <p>39* Following is the list of specific options recognized by40* <code>AgrumentHandler</code>:41* <ul>42* <li> <code>-connector=[attaching|listening]</code> -43* JDWP connection type44* <li> <code>-transport=[socket|shmem]</code> -45* JDWP transport kind46* </ul>47* <p>48* See also list of arguments recognized by the base <code>DebugeeArgumnethandler</code>49* and <code>ArgumentParser</code> classes.50* <p>51* See also description of <code>ArgumentParser</code> how to work with52* command line arguments and options.53*54* @see ArgumentParser55* @see DebugeeArgumentHandler56*/57public class ArgumentHandler extends DebugeeArgumentHandler {5859/**60* Keep a copy of raw command-line arguments and parse them;61* but throw an exception on parsing error.62*63* @param args Array of the raw command-line arguments.64*65* @throws NullPointerException If <code>args==null</code>.66* @throws IllegalArgumentException If Binder or Log options67* are set incorrectly.68*69* @see #setRawArguments(String[])70*/71public ArgumentHandler(String args[]) {72super(args);73}7475/**76* Check if an option is admissible and has proper value.77* This method is invoked by <code>parseArguments()</code>78*79* @param option option name80* @param value string representation of value (could be an empty string)81* null if this option has no value82* @return <i>true</i> if option is admissible and has proper value83* <i>false</i> if otion is not admissible84*85* @throws <i>BadOption</i> if option has illegal value86*87* @see #parseArguments()88*/89protected boolean checkOption(String option, String value) {90return super.checkOption(option, value);91}9293/**94* Check options against inconcistence.95* This method is invoked by <code>parseArguments()</code>96*97* @see #parseArguments()98*/99protected void checkOptions() {100101if (isShmemTransport()) {102throw new BadOption("transport: shared memory transport is not supported yet");103}104105super.checkOptions();106}107108}109110111