public class CLIBootstrap extends Object
The user might have specified JVM options as well as ACC options as well as arguments to be passed to the client. Further, we need to make sure that the GlassFish extension libraries directories and endorsed directories are included in java.ext.dirs and java.endorsed.dirs, regardless of whether the user specified any explicitly.
This program emits a java command line that will run the ACC so that it will launch the client. The emitted command will need to look like this:
java \
(user-specified JVM options except -jar) \
(settings for java.ext.dirs and java.endorsed.dirs) \
-javaagent:(path-to-gf-client.jar)=(option string for our agent) \
(main class setting: "-jar x.jar" or "a.b.Main" or "path-to-file.class")
(arguments to be passed to the client)
The general design of this class uses several inner classes, CommandLineElement and its extensions. These classes have slightly different behavior depending on the specific type of command line element each represents. Each has a regex pattern which it uses to decide whether it recognizes a particular command line element or not. Each also implements (or inherits) the processValue method which actually consumes the command line element being handled -- and sometimes the next one as well if the element takes a value (such as -classpath).
| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_OPTIONS_INTRODUCER |
| Modifier and Type | Method and Description |
|---|---|
static String |
decodeArg(String s)
Replaces occurrences of comma encoding with commas.
|
static String |
encodeArg(String s)
Replaces commas in an argument value (which can confuse the ACC agent
argument parsing because shells strip out double-quotes) with a special
sequence.
|
static void |
main(String[] args) |
public static final String FILE_OPTIONS_INTRODUCER
public static void main(String[] args)
args - the command line argumentspublic static String encodeArg(String s)
s - string to encodeCopyright © 2017. All rights reserved.