当前位置: 首页>>代码示例>>Java>>正文


Java PlatformManagedObject类代码示例

本文整理汇总了Java中java.lang.management.PlatformManagedObject的典型用法代码示例。如果您正苦于以下问题:Java PlatformManagedObject类的具体用法?Java PlatformManagedObject怎么用?Java PlatformManagedObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PlatformManagedObject类属于java.lang.management包,在下文中一共展示了PlatformManagedObject类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: submitTasks

import java.lang.management.PlatformManagedObject; //导入依赖的package包/类
static void submitTasks(ExecutorService executor, int count) {
    for (int i=0; i < count && !failed; i++) {
        executor.execute(new Runnable() {
            @Override
            public void run() {
                List<PlatformManagedObject> mbeans = new ArrayList<>();
                mbeans.add(ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class));
                mbeans.addAll(ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class));
                for (PlatformManagedObject pmo : mbeans) {
                    // Name should not be null
                    if (pmo.getObjectName() == null) {
                        failed = true;
                        throw new RuntimeException("TEST FAILED: getObjectName() returns null");
                    }
                }
            }
        });
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:GetObjectName.java

示例2: HeapDumpCreator

import java.lang.management.PlatformManagedObject; //导入依赖的package包/类
HeapDumpCreator(final Configuration configuration, final String hostName,
                final PlatformManagedObject heapDumpBean, final CommandExecutor commandExecutor,
                final Logger logger) throws Exception {
  this.configuration = configuration;
  this.nameFormatter = new HeapDumpNameFormatter(configuration.getHeapDumpName(), hostName);
  this.heapDumpBean = heapDumpBean;
  this.heapDumpMethod =
      heapDumpBean.getClass().getMethod("dumpHeap", String.class, boolean.class);
  this.commandExecutor = commandExecutor;
  this.logger = logger;
}
 
开发者ID:SAP,项目名称:java-memory-assistant,代码行数:12,代码来源:HeapDumpCreator.java

示例3: HotSpotDiagnosticMXBeanHeapDumper

import java.lang.management.PlatformManagedObject; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected HotSpotDiagnosticMXBeanHeapDumper() {
	try {
		Class<?> diagnosticMXBeanClass = ClassUtils.resolveClassName(
				"com.sun.management.HotSpotDiagnosticMXBean", null);
		this.diagnosticMXBean = ManagementFactory.getPlatformMXBean(
				(Class<PlatformManagedObject>) diagnosticMXBeanClass);
		this.dumpHeapMethod = ReflectionUtils.findMethod(diagnosticMXBeanClass,
				"dumpHeap", String.class, Boolean.TYPE);
	}
	catch (Throwable ex) {
		throw new HeapDumperUnavailableException(
				"Unable to locate HotSpotDiagnosticMXBean", ex);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:16,代码来源:HeapdumpMvcEndpoint.java

示例4: getBean

import java.lang.management.PlatformManagedObject; //导入依赖的package包/类
@Nullable
private static <T extends PlatformManagedObject> T getBean(final Class<T> iface) {
    final String name = iface.getCanonicalName();
    T ret;
    try {
        ret = ManagementFactory.getPlatformMXBean(iface);
    } catch (IllegalArgumentException e) {
        LOG.warn("error getting bean {}", name, e);
        return null;
    }
    if (ret == null) {
        LOG.warn("bean {} did not exist", name);
    }
    return ret;
}
 
开发者ID:opentable,项目名称:otj-jvm,代码行数:16,代码来源:Memory.java

示例5: HotSpotDiagnosticMXBeanHeapDumper

import java.lang.management.PlatformManagedObject; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected HotSpotDiagnosticMXBeanHeapDumper() {
    try {
        Class<?> diagnosticMXBeanClass = ClassUtils.resolveClassName("com.sun.management.HotSpotDiagnosticMXBean", null);
        this.diagnosticMXBean = ManagementFactory.getPlatformMXBean((Class<PlatformManagedObject>) diagnosticMXBeanClass);
        this.dumpHeapMethod = ReflectionUtils.findMethod(diagnosticMXBeanClass, "dumpHeap", String.class, Boolean.TYPE);
    } catch (Throwable ex) {
        throw new HeapDumperUnavailableException("Unable to locate HotSpotDiagnosticMXBean", ex);
    }
}
 
开发者ID:Indoqa,项目名称:indoqa-boot,代码行数:11,代码来源:HeapDumpResources.java

示例6: getMXBean

import java.lang.management.PlatformManagedObject; //导入依赖的package包/类
/**
 * Returns the extended platform MXBean implementing the given
 * mxbeanInterface, or null if there is no such MXBean.
 */
public static <T extends PlatformManagedObject>
        T getMXBean(Class<T> mxbeanInterface) {
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ExtendedPlatformComponent.java

示例7: getMXBeans

import java.lang.management.PlatformManagedObject; //导入依赖的package包/类
/**
 * Get the extended set of platform MXBeans that should be registered in the
 * platform MBeanServer, or an empty list if there are no such MXBeans.
 */
public static List<? extends PlatformManagedObject> getMXBeans() {
    return Collections.emptyList();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ExtendedPlatformComponent.java


注:本文中的java.lang.management.PlatformManagedObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。