3261N/A * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class is the main class for the JInfo utility. It parses its arguments 0N/A * and decides if the command should be satisifed using the VM attach mechanism 0N/A * or an SA tool. At this time the only option that uses the VM attach 0N/A * mechanism is the -flag option to set or print a command line option of a 0N/A * running application. All other options are mapped to SA tools. 0N/A // SA JInfo needs <pid> or <server> or 0N/A // (<executable> and <code file>). So, total 0N/A // argument count including option has to 2 or 3. 0N/A // do not use SA, use attach-on-demand 0N/A // unknown option or -h or -help, print help 0N/A // Invoke SA tool with the given arguments 0N/A // Tool not available on this platform. 0N/A // invoke the main method with the arguments 0N/A // loads the given class using the system class loader 0N/A // We specify the system clas loader so as to cater for development 0N/A // environments where this class is on the boot class path but sa-jdi.jar 0N/A // is on the system class path. Once the JDK is deployed then both 0N/A // tools.jar and sa-jdi.jar are on the system class path. 0N/A // Attach to <pid>, exiting if we fail to attach 0N/A return null;
// keep compiler happy 0N/A // Read the stream from the target VM until EOF, then detach 0N/A // read to EOF and just print output 0N/A byte b[] =
new byte[
256];
0N/A // print usage message