/*
* 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.
*/
package sun.management;
/**
* Implementation of VMManagement interface that accesses the management
* attributes and operations locally within the same Java virtual
* machine.
*/
private static boolean compTimeMonitoringSupport;
private static boolean threadContentionMonitoringSupport;
private static boolean currentThreadCpuTimeSupport;
private static boolean otherThreadCpuTimeSupport;
private static boolean bootClassPathSupport;
private static boolean objectMonitorUsageSupport;
private static boolean synchronizerUsageSupport;
private static boolean threadAllocatedMemorySupport;
private static boolean gcNotificationSupport;
static {
version = getVersion0();
throw new AssertionError("Invalid Management Version");
}
}
private native static void initOptionalSupportFields();
// Optional supports
public boolean isCompilationTimeMonitoringSupported() {
return compTimeMonitoringSupport;
}
public boolean isThreadContentionMonitoringSupported() {
}
public boolean isCurrentThreadCpuTimeSupported() {
return currentThreadCpuTimeSupport;
}
public boolean isOtherThreadCpuTimeSupported() {
return otherThreadCpuTimeSupport;
}
public boolean isBootClassPathSupported() {
return bootClassPathSupport;
}
public boolean isObjectMonitorUsageSupported() {
return objectMonitorUsageSupport;
}
public boolean isSynchronizerUsageSupported() {
return synchronizerUsageSupport;
}
public boolean isThreadAllocatedMemorySupported() {
return threadAllocatedMemorySupport;
}
public boolean isGcNotificationSupported() {
return gcNotificationSupport;
}
public native boolean isThreadContentionMonitoringEnabled();
public native boolean isThreadCpuTimeEnabled();
public native boolean isThreadAllocatedMemoryEnabled();
// Class Loading Subsystem
public int getLoadedClassCount() {
return (int) count;
}
public native long getTotalClassCount();
public native long getUnloadedClassCount();
public native boolean getVerboseClass();
// Memory Subsystem
public native boolean getVerboseGC();
// Runtime Subsystem
return version;
}
int pid = getProcessId();
try {
} catch (UnknownHostException e) {
// ignore
}
}
private native int getProcessId();
}
}
}
}
}
}
}
}
= new GetPropertyAction("sun.boot.class.path");
return result;
}
}
return vmArgs;
}
public native long getStartupTime();
public native int getAvailableProcessors();
// Compilation Subsystem
new PrivilegedAction<String>() {
}
});
return name;
}
public native long getTotalCompileTime();
// Thread Subsystem
public native long getTotalThreadCount();
public native int getLiveThreadCount();
public native int getPeakThreadCount();
public native int getDaemonThreadCount();
// Operating System
}
}
}
// Hotspot-specific runtime support
public native long getSafepointCount();
public native long getTotalSafepointTime();
public native long getSafepointSyncTime();
public native long getTotalApplicationNonStoppedTime();
public native long getLoadedClassSize();
public native long getUnloadedClassSize();
public native long getClassLoadingTime();
public native long getMethodDataSize();
public native long getInitializedClassCount();
public native long getClassInitializationTime();
public native long getClassVerificationTime();
// Performance Counter Support
private boolean noPerfData = false;
return perfInstr;
}
// construct PerfInstrumentation object
try {
noPerfData = true;
return null;
}
} catch (IllegalArgumentException e) {
// If the shared memory doesn't exist e.g. if -XX:-UsePerfData
// was set
noPerfData = true;
} catch (IOException e) {
throw new AssertionError(e);
}
return perfInstr;
}
} else {
return Collections.emptyList();
}
}
}