Examples of GarbageCollectorMXBean


Examples of java.lang.management.GarbageCollectorMXBean

    public void testNewPlatformMXBeanProxy_GarbageCollectorMXBean()
            throws Exception {
        List<GarbageCollectorMXBean> allBeans = ManagementFactory
                .getGarbageCollectorMXBeans();
        for (GarbageCollectorMXBean mb : allBeans) {
            GarbageCollectorMXBean proxy = ManagementFactory
                    .newPlatformMXBeanProxy(ManagementFactory
                            .getPlatformMBeanServer(),
                            "java.lang:type=GarbageCollector,name="
                                    + mb.getName(),
                            GarbageCollectorMXBean.class);
            assertEquals(mb.getName(), proxy.getName());
            assertEquals(mb.isValid(), proxy.isValid());
            assertEquals(mb.getCollectionCount(), proxy.getCollectionCount());
            String[] poolNames1 = mb.getMemoryPoolNames();
            String[] poolNames2 = proxy.getMemoryPoolNames();
            assertEquals(poolNames1.length, poolNames2.length);
            for (int i = 0; i < poolNames1.length; i++) {
                String string = poolNames1[i];
                assertEquals(poolNames1[i], poolNames2[i]);
            }
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

            }
            mbeans = mbsc.queryNames(gcName, null);
            if (mbeans != null) {
                gcmbeans = new ArrayList<GarbageCollectorMXBean>();
                Iterator iterator = mbeans.iterator();
                GarbageCollectorMXBean gc = null;
                while (iterator.hasNext()) {
                    ObjectName objName = (ObjectName) iterator.next();
                    gc = ManagementFactory.newPlatformMXBeanProxy(mbsc,
                                               objName.getCanonicalName(),
                                               GarbageCollectorMXBean.class);
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

        try
        {
            ObjectName gcName = new ObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",*");
            for (ObjectName name : server.queryNames(gcName, null))
            {
                GarbageCollectorMXBean gc = ManagementFactory.newPlatformMXBeanProxy(server, name.getCanonicalName(), GarbageCollectorMXBean.class);
                beans.add(gc);
            }
        }
        catch (Exception e)
        {
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

                Iterator<ObjectName> iterator = mbeans.iterator();
                while (iterator.hasNext()) {
                    ObjectName on = (ObjectName) iterator.next();
                    String name = GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=" + on.getKeyProperty("name");

                    GarbageCollectorMXBean mBean = newPlatformMXBeanProxy(server, name, GarbageCollectorMXBean.class);
                    garbageCollectorMBeans.add(mBean);
                }
            }
        }
        return garbageCollectorMBeans;
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

        try
        {
            ObjectName gcName = new ObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",*");
            for (ObjectName name : server.queryNames(gcName, null))
            {
                GarbageCollectorMXBean gc = ManagementFactory.newPlatformMXBeanProxy(server, name.getCanonicalName(), GarbageCollectorMXBean.class);
                beans.add(gc);
            }
        }
        catch (Exception e)
        {
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

    public void testNewPlatformMXBeanProxy_GarbageCollectorMXBean()
            throws Exception {
        List<GarbageCollectorMXBean> allBeans = ManagementFactory
                .getGarbageCollectorMXBeans();
        for (GarbageCollectorMXBean mb : allBeans) {
            GarbageCollectorMXBean proxy = ManagementFactory
                    .newPlatformMXBeanProxy(ManagementFactory
                            .getPlatformMBeanServer(),
                            "java.lang:type=GarbageCollector,name="
                                    + mb.getName(),
                            GarbageCollectorMXBean.class);
            assertEquals(mb.getName(), proxy.getName());
            assertEquals(mb.isValid(), proxy.isValid());
            assertEquals(mb.getCollectionCount(), proxy.getCollectionCount());
            String[] poolNames1 = mb.getMemoryPoolNames();
            String[] poolNames2 = proxy.getMemoryPoolNames();
            assertEquals(poolNames1.length, poolNames2.length);
            for (int i = 0; i < poolNames1.length; i++) {
                assertEquals(poolNames1[i], poolNames2[i]);
            }
        }
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

         Set<ObjectName> mbeans = con.queryNames(gcName, null);
         if (mbeans != null) {
            gcMbeans = new ArrayList<GarbageCollectorMXBean>();
            for (ObjectName on : mbeans) {
               String name = GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=" + on.getKeyProperty("name");
               GarbageCollectorMXBean mbean = newPlatformMXBeanProxy(con, name, GarbageCollectorMXBean.class);
               gcMbeans.add(mbean);
            }
         }
      }
      return gcMbeans;
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

        try
        {
            ObjectName gcName = new ObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",*");
            for (ObjectName name : server.queryNames(gcName, null))
            {
                GarbageCollectorMXBean gc = ManagementFactory.newPlatformMXBeanProxy(server, name.getCanonicalName(), GarbageCollectorMXBean.class);
                beans.add(gc);
            }
        }
        catch (Exception e)
        {
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

        try
        {
            ObjectName gcName = new ObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",*");
            for (ObjectName name : server.queryNames(gcName, null))
            {
                GarbageCollectorMXBean gc = ManagementFactory.newPlatformMXBeanProxy(server, name.getCanonicalName(), GarbageCollectorMXBean.class);
                beans.add(gc);
            }
        }
        catch (Exception e)
        {
View Full Code Here

Examples of java.lang.management.GarbageCollectorMXBean

        try
        {
            ObjectName gcName = new ObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",*");
            for (ObjectName name : server.queryNames(gcName, null))
            {
                GarbageCollectorMXBean gc = ManagementFactory.newPlatformMXBeanProxy(server, name.getCanonicalName(), GarbageCollectorMXBean.class);
                beans.add(gc);
            }
        }
        catch (Exception e)
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.