/*
* 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;
/**
* ManagementFactoryHelper provides static factory methods to create
* instances of the management interface.
*/
public class ManagementFactoryHelper {
private ManagementFactoryHelper() {};
if (classMBean == null) {
}
return classMBean;
}
if (memoryMBean == null) {
}
return memoryMBean;
}
if (threadMBean == null) {
}
return threadMBean;
}
if (runtimeMBean == null) {
}
return runtimeMBean;
}
}
return compileMBean;
}
}
return osMBean;
}
for (MemoryPoolMXBean p : pools) {
}
return list;
}
for (MemoryManagerMXBean m : mgrs) {
}
return result;
}
for (MemoryManagerMXBean m : mgrs) {
if (GarbageCollectorMXBean.class.isInstance(m)) {
}
}
return result;
}
if (LoggingSupport.isAvailable()) {
return PlatformLoggingImpl.instance;
} else {
return null;
}
}
// The logging MXBean object is an instance of
// PlatformLoggingMXBean and java.util.logging.LoggingMXBean
// but it can't directly implement two MXBean interfaces
// as a compliant MXBean implements exactly one MXBean interface,
// or if it implements one interface that is a subinterface of
// all the others; otherwise, it is a non-compliant MXBean
// and MBeanServer will throw NotCompliantMBeanException.
// See the Definition of an MXBean section in javax.management.MXBean spec.
//
// To create a compliant logging MXBean, define a LoggingMXBean interface
// that extend PlatformLoggingMXBean and j.u.l.LoggingMXBean
interface LoggingMXBean
}
{
synchronized (this) {
}
}
}
return result;
}
return LoggingSupport.getLoggerNames();
}
}
}
}
}
if (bufferPools == null) {
.getDirectBufferPool()));
.getMappedBufferPool()));
}
return bufferPools;
}
/**
* Creates management interface for the given buffer pool.
*/
private static BufferPoolMXBean
{
return new BufferPoolMXBean() {
public ObjectName getObjectName() {
synchronized (this) {
}
}
}
return result;
}
}
public long getCount() {
}
public long getTotalCapacity() {
return pool.getTotalCapacity();
}
public long getMemoryUsed() {
return pool.getMemoryUsed();
}
};
}
if (hsDiagMBean == null) {
hsDiagMBean = new HotSpotDiagnostic();
}
return hsDiagMBean;
}
/**
* This method is for testing only.
*/
if (hsRuntimeMBean == null) {
}
return hsRuntimeMBean;
}
/**
* This method is for testing only.
*/
if (hsClassMBean == null) {
}
return hsClassMBean;
}
/**
* This method is for testing only.
*/
if (hsThreadMBean == null) {
}
return hsThreadMBean;
}
/**
* This method is for testing only.
*/
if (hsMemoryMBean == null) {
}
return hsMemoryMBean;
}
/**
* This method is for testing only.
*/
if (hsCompileMBean == null) {
}
return hsCompileMBean;
}
/**
* Registers a given MBean if not registered in the MBeanServer;
* otherwise, just return.
*/
try {
// inner class requires these fields to be final
try {
return null;
} catch (InstanceAlreadyExistsException e) {
// if an instance with the object name exists in
// the MBeanServer ignore the exception
}
return null;
}
});
} catch (PrivilegedActionException e) {
}
}
"sun.management:type=HotspotClassLoading";
"sun.management:type=HotspotCompilation";
"sun.management:type=HotspotMemory";
"sun.management:type=HotspotRuntime";
"sun.management:type=HotspotThreading";
// register all internal MBeans if not registered
// No exception is thrown if a MBean with that object name
// already registered
// CompilationMBean may not exist
if (getCompilationMXBean() != null) {
}
}
try {
// inner class requires these fields to be final
try {
} catch (InstanceNotFoundException e) {
// ignore exception if not found
}
return null;
}
});
} catch (PrivilegedActionException e) {
}
}
// unregister all internal MBeans
// CompilationMBean may not exist
if (getCompilationMXBean() != null) {
}
}
static {
jvm = new VMManagementImpl();
}
}
}
// suspended and native bits may be set in state
}
// These values are defined in jmm.h
}