Java 类java.lang.management.PlatformManagedObject 实例源码

项目:jdk8u-jdk    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:openjdk-jdk10    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:openjdk9    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:jdk8u_jdk    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:infobip-open-jdk-8    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:jdk8u-dev-jdk    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:OLD-OpenJDK8    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:openjdk-jdk7u-jdk    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:openjdk-icedtea7    文件:GetObjectName.java   
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");
                    }
                }
            }
        });
    }
}
项目:java-memory-assistant    文件:HeapDumpCreator.java   
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;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HeapdumpMvcEndpoint.java   
@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);
    }
}
项目:otj-jvm    文件:Memory.java   
@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;
}
项目:indoqa-boot    文件:HeapDumpResources.java   
@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);
    }
}
项目:OpenJSharp    文件:ExtendedPlatformComponent.java   
/**
 * 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;
}
项目:jdk8u-jdk    文件:ExtendedPlatformComponent.java   
/**
 * 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;
}
项目:jdk8u_jdk    文件:ExtendedPlatformComponent.java   
/**
 * 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;
}
项目:lookaside_java-1.8.0-openjdk    文件:ExtendedPlatformComponent.java   
/**
 * 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;
}
项目:infobip-open-jdk-8    文件:ExtendedPlatformComponent.java   
/**
 * 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;
}
项目:jdk8u-dev-jdk    文件:ExtendedPlatformComponent.java   
/**
 * 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;
}
项目:OpenJSharp    文件:ExtendedPlatformComponent.java   
/**
 * 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();
}
项目:jdk8u-jdk    文件:ExtendedPlatformComponent.java   
/**
 * 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();
}
项目:jdk8u_jdk    文件:ExtendedPlatformComponent.java   
/**
 * 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();
}
项目:lookaside_java-1.8.0-openjdk    文件:ExtendedPlatformComponent.java   
/**
 * 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();
}
项目:infobip-open-jdk-8    文件:ExtendedPlatformComponent.java   
/**
 * 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();
}
项目:jdk8u-dev-jdk    文件:ExtendedPlatformComponent.java   
/**
 * 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();
}