ClassLoadingImpl.java revision 1790
4049N/A/*
4049N/A * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
4049N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4049N/A *
4049N/A * This code is free software; you can redistribute it and/or modify it
4049N/A * under the terms of the GNU General Public License version 2 only, as
4049N/A * published by the Free Software Foundation. Sun designates this
4049N/A * particular file as subject to the "Classpath" exception as provided
4049N/A * by Sun in the LICENSE file that accompanied this code.
4049N/A *
4049N/A * This code is distributed in the hope that it will be useful, but WITHOUT
4049N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4049N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4049N/A * version 2 for more details (a copy is included in the LICENSE file that
4049N/A * accompanied this code).
4049N/A *
4049N/A * You should have received a copy of the GNU General Public License version
4049N/A * 2 along with this work; if not, write to the Free Software Foundation,
4049N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4049N/A *
4049N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
4049N/A * CA 95054 USA or visit www.sun.com if you need additional information or
4049N/A * have any questions.
4049N/A */
4049N/A
4049N/Apackage sun.management;
4049N/A
4049N/Aimport java.lang.management.ClassLoadingMXBean;
4049N/Aimport java.lang.management.ManagementFactory;
4049N/Aimport javax.management.ObjectName;
4049N/A
4049N/A/**
4049N/A * Implementation class for the class loading subsystem.
4049N/A * Standard and committed hotspot-specific metrics if any.
4049N/A *
4049N/A * ManagementFactory.getClassLoadingMXBean() returns an instance
4049N/A * of this class.
4049N/A */
4049N/Aclass ClassLoadingImpl implements ClassLoadingMXBean {
4049N/A
4049N/A private final VMManagement jvm;
4049N/A
4049N/A /**
4049N/A * Constructor of ClassLoadingImpl class.
4049N/A */
4049N/A ClassLoadingImpl(VMManagement vm) {
4049N/A this.jvm = vm;
4049N/A }
4049N/A
4049N/A public long getTotalLoadedClassCount() {
4049N/A return jvm.getTotalClassCount();
4049N/A }
4049N/A
4049N/A public int getLoadedClassCount() {
4049N/A return jvm.getLoadedClassCount();
4049N/A }
4049N/A
4049N/A public long getUnloadedClassCount() {
4049N/A return jvm.getUnloadedClassCount();
4049N/A }
4049N/A
4049N/A public boolean isVerbose() {
4049N/A return jvm.getVerboseClass();
4049N/A }
4049N/A
4049N/A public void setVerbose(boolean value) {
4049N/A Util.checkControlAccess();
4049N/A
4049N/A setVerboseClass(value);
4049N/A }
4049N/A native static void setVerboseClass(boolean value);
4049N/A
4049N/A public ObjectName getObjectName() {
4049N/A return Util.newObjectName(ManagementFactory.CLASS_LOADING_MXBEAN_NAME);
4049N/A }
4049N/A}
4049N/A