/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*com.sun.tools.attach.AttachNotSupportedException
* 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.
*/
public class JCmd {
try {
} catch (IllegalArgumentException ex) {
+ "\n");
}
if (arg.isShowUsage()) {
}
if (arg.isListProcesses()) {
}
}
// find all VMs
if (!isJCmdProcess(vmd)) {
}
}
// use the partial class-name match
if (isJCmdProcess(vmd)) {
continue;
}
try {
}
} catch (MonitorException|URISyntaxException e) {
if (e.getMessage() != null) {
} else {
} else {
e.printStackTrace();
}
}
}
}
}
} else {
// Use the found pid
}
if (arg.isListCounters()) {
} else {
try {
}
}
}
}
throws AttachNotSupportedException, IOException,
// Cast to HotSpotVirtualMachine as this is an
// implementation specific method.
break;
}
// read to EOF and just print output
byte b[] = new byte[256];
int n;
do {
if (n > 0) {
}
} while (n > 0);
}
}
}
// Code from JStat (can't call it directly since it does System.exit)
try {
} catch (URISyntaxException e) {
return;
}
try {
new AscendingMonitorComparator(), // comparator
false, // not verbose
true, // show unsupported
} catch (MonitorException ex) {
}
}
try {
return false;
}
}
throws URISyntaxException, MonitorException {
try {
return mainClass;
} catch(NullPointerException e) {
// There is a potential race, where a running java app is being
// queried, unfortunately the java app has shutdown after this
// method is started but before getMonitoredVM is called.
// If this is the case, then the /tmp/hsperfdata_xxx/pid file
// will have disappeared and we will get a NullPointerException.
// Handle this gracefully....
return null;
}
}
/**
* Class to compare two Monitor objects by name in ascending order.
* (from jstat)
*/
}
}
}