/*
* 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.
*/
/*
* This class is the main class for the JInfo utility. It parses its arguments
* and decides if the command should be satisifed using the VM attach mechanism
* or an SA tool. At this time the only option that uses the VM attach
* mechanism is the -flag option to set or print a command line option of a
* running application. All other options are mapped to SA tools.
*/
public class JInfo {
usage(); // no arguments
}
boolean useSA = true;
// SA JInfo needs <pid> or <server> or
// (<executable> and <code file>). So, total
// argument count including option has to 2 or 3.
usage();
}
// do not use SA, use attach-on-demand
useSA = false;
} else {
// unknown option or -h or -help, print help
usage();
}
}
if (useSA) {
} else {
} else {
usage();
}
}
}
// Invoke SA tool with the given arguments
// Tool not available on this platform.
if (c == null) {
usage();
}
// invoke the main method with the arguments
}
// loads the given class using the system class loader
//
// We specify the system clas loader so as to cater for development
// environments where this class is on the boot class path but sa-jdi.jar
// is on the system class path. Once the JDK is deployed then both
// tools.jar and sa-jdi.jar are on the system class path.
//
try {
} catch (Exception x) { }
return null;
}
if (index != -1) {
} else {
switch (c) {
case '+':
break;
case '-':
break;
default:
break;
}
}
}
// Attach to <pid>, exiting if we fail to attach
try {
} catch (Exception x) {
} else {
x.printStackTrace();
}
return null; // keep compiler happy
}
}
// Read the stream from the target VM until EOF, then detach
// read to EOF and just print output
byte b[] = new byte[256];
int n;
do {
if (n > 0) {
}
} while (n > 0);
}
// print usage message
private static void usage() {
if (usageSA) {
} else {
}
}
}