Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/share/jdwp/ArgumentHandler.java
41162 views
1
/*
2
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
package nsk.share.jdwp;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
29
import java.io.*;
30
import java.util.*;
31
32
/**
33
* Parser for JDWP test's specific command-line arguments.
34
* <p>
35
* <code>ArgumentHandler</code> handles JDWP test's specific
36
* arguments related to launching debugee VM using JDWP features
37
* in addition to general arguments recognized by
38
* <code>DebugeeArgumentHandler</code> and <code>ArgumentParser</code>.
39
* <p>
40
* Following is the list of specific options recognized by
41
* <code>AgrumentHandler</code>:
42
* <ul>
43
* <li> <code>-connector=[attaching|listening]</code> -
44
* JDWP connection type
45
* <li> <code>-transport=[socket|shmem]</code> -
46
* JDWP transport kind
47
* </ul>
48
* <p>
49
* See also list of arguments recognized by the base <code>DebugeeArgumnethandler</code>
50
* and <code>ArgumentParser</code> classes.
51
* <p>
52
* See also description of <code>ArgumentParser</code> how to work with
53
* command line arguments and options.
54
*
55
* @see ArgumentParser
56
* @see DebugeeArgumentHandler
57
*/
58
public class ArgumentHandler extends DebugeeArgumentHandler {
59
60
/**
61
* Keep a copy of raw command-line arguments and parse them;
62
* but throw an exception on parsing error.
63
*
64
* @param args Array of the raw command-line arguments.
65
*
66
* @throws NullPointerException If <code>args==null</code>.
67
* @throws IllegalArgumentException If Binder or Log options
68
* are set incorrectly.
69
*
70
* @see #setRawArguments(String[])
71
*/
72
public ArgumentHandler(String args[]) {
73
super(args);
74
}
75
76
/**
77
* Check if an option is admissible and has proper value.
78
* This method is invoked by <code>parseArguments()</code>
79
*
80
* @param option option name
81
* @param value string representation of value (could be an empty string)
82
* null if this option has no value
83
* @return <i>true</i> if option is admissible and has proper value
84
* <i>false</i> if otion is not admissible
85
*
86
* @throws <i>BadOption</i> if option has illegal value
87
*
88
* @see #parseArguments()
89
*/
90
protected boolean checkOption(String option, String value) {
91
return super.checkOption(option, value);
92
}
93
94
/**
95
* Check options against inconcistence.
96
* This method is invoked by <code>parseArguments()</code>
97
*
98
* @see #parseArguments()
99
*/
100
protected void checkOptions() {
101
102
if (isShmemTransport()) {
103
throw new BadOption("transport: shared memory transport is not supported yet");
104
}
105
106
super.checkOptions();
107
}
108
109
}
110
111