/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*
* <p><b>This is NOT part of any API supported by Sun Microsystems.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.</b>
*
*/
/**
* A utility package for the java(1), javaw(1) launchers.
* The following are helper methods that the native launcher uses
*/
public enum LauncherHelper {
// sync with java.c and sun.misc.VM
"sun.launcher.resources.launcher";
private static class ResourceBundleHolder {
}
/*
* A method called by the launcher to print out the standard settings,
* by default -XshowSettings is equivalent to -XshowSettings:all,
* Specific information may be gotten by using suboptions with possible
* values vm, properties and locale.
*
* printToStderr: choose between stdout and stderr
*
* optionFlag: specifies which options to print default is all other
* possible values are vm, properties, locale.
*
* initialHeapSize: in bytes, as set by the launcher, a zero-value indicates
* this code should determine this value, using a suitable method or
* the line could be omitted.
*
* maxHeapSize: in bytes, as set by the launcher, a zero-value indicates
* this code should determine this value, using a suitable method.
*
* stackSize: in bytes, as set by the launcher, a zero-value indicates
* this code determine this value, using a suitable method or omit the
* line entirely.
*/
boolean isServer) {
: "all";
switch (optStr) {
case "vm":
break;
case "properties":
break;
case "locale":
break;
default:
break;
}
}
/*
*/
long initialHeapSize, long maxHeapSize,
if (stackSize != 0L) {
}
if (initialHeapSize != 0L) {
}
if (maxHeapSize != 0L) {
} else {
}
}
/*
*/
for (String x : sortedPropertyKeys) {
}
}
}
switch (b) {
case 0xd:
break;
case 0xa:
break;
default:
// print any bizzare line separators in hex, but really
// shouldn't happen.
break;
}
}
return;
}
return;
}
boolean first = true;
if (first) { // first line treated specially
first = false;
} else { // following lines prefix with indents
}
}
}
/*
*/
}
if (len < 1 ) {
return;
}
// Locale does not implement Comparable so we convert it to String
// and sort it for pretty printing.
}
if (i != last) {
}
// print columns of 8
if ((i + 1) % 8 == 0) {
}
}
}
private enum SizePrefix {
long size;
}
}
/*
* scale the incoming values to a human readable form, represented as
* K, M, G and T, see java.c parse_size for the scaled values and
* suffixes. The lowest possible scaled value is Kilo.
*/
} else {
}
}
}
/**
* A private helper method to get a localized message and also
* apply any arguments that we might pass.
*/
}
/**
* The java -help message is split into 3 parts, an invariant, followed
* by a set of platform dependent variant messages, finally an invariant
* set of lines.
* This method initializes the help message for the first time, and also
* assembles the invariant header part of the message.
*/
32));
64));
}
/**
* Appends the vm selection messages to the header, already created.
* initHelpSystem must already be called.
*/
}
/**
* Appends the vm synoym message to the header, already created.
* initHelpSystem must be called before using this method.
*/
}
/**
* Appends the vm Ergo message to the header, already created.
* initHelpSystem must be called before using this method.
*/
vm));
outBuf = (isServerClass)
}
/**
* Appends the last invariant part to the previously created messages,
* and finishes up the printing to the desired output stream.
* initHelpSystem must be called before using this method.
*/
}
/**
* Prints the Xusage text to the desired output stream.
*/
}
}
try {
try {
}
}
}
} finally {
}
}
} catch (IOException ioe) {
}
return null;
}
// enum LaunchMode { LM_UNKNOWN = 0, LM_CLASS, LM_JAR };
}
if (trace) {
if (t != null) {
t.printStackTrace();
} else {
}
}
}
/**
* This method does the following:
* 1. gets the classname from a Jar's manifest, if necessary
* 2. loads the class using the System ClassLoader
* 3. ensures the availability and accessibility of the main method,
* using signatureDiagnostic method.
* a. does the class exist
* b. is there a main
* c. is the main public
* d. is the main static
* c. does the main take a String array for args
* 4. and off we go......
*
* @param printToStderr
* @param isJar
* @param name
* @return
*/
int mode,
// get the class name
switch (mode) {
case LM_CLASS:
break;
case LM_JAR:
break;
default:
// should never happen
}
try {
} catch (ClassNotFoundException cnfe) {
}
getMainMethod(ostream, c);
return c;
}
try {
} catch (NoSuchMethodException nsme) {
}
/*
* getMethod (above) will choose the correct method, based
* on its name and parameter type, however, we still have to
* ensure that the method is static and returns a void.
*/
}
}
return method;
}
private static boolean isCharsetSupported = false;
/*
* converts a c or a byte array to a platform specific string,
* previously implemented as a native method in the launcher.
*/
}
try {
return out;
} catch (UnsupportedEncodingException uee) {
}
return null; // keep the compiler happy
}
}
return expandArgs(aList);
}
if (trace) {
}
if (trace) {
}
if (a.needsExpansion) {
}
int entries = 0;
entries++;
}
if (entries == 0) {
}
} catch (Exception e) {
if (trace) {
}
}
} else {
}
}
if (trace) {
}
}
return oarray;
}
/* duplicate of the native StdArg struct */
private static class StdArg {
final boolean needsExpansion;
this.needsExpansion = expand;
}
// protocol: first char indicates whether expansion is required
// 'T' = true ; needs expansion
// 'F' = false; needs no expansion
}
}
}
}