Package javax.management

Examples of javax.management.MBeanServer.queryNames()


    {
        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        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);
            }
        }
View Full Code Here


        assertMockEndpointsSatisfied();

        // get the stats for the route
        MBeanServer mbeanServer = getMBeanServer();
        Set<ObjectName> set = mbeanServer.queryNames(new ObjectName("*:type=services,*"), null);
        List<ObjectName> list = new ArrayList<ObjectName>(set);
        ObjectName on = null;
        for (ObjectName name : list) {
            if (name.getCanonicalName().contains("ProducerCache")) {
                on = name;
View Full Code Here

        MBeanServer mbeanServer = getMBeanServer();
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=services,name=ProducerCache*");

        // number of producer caches
        Set<ObjectName> names = mbeanServer.queryNames(on, null);
        assertEquals(1, names.size());
       
        log.info("Adding 2nd route");

        // add a 2nd route
View Full Code Here

        bar.expectedMessageCount(1);
        template.sendBody("direct:bar", "Hello World");
        bar.assertIsSatisfied();

        // there should be one more producer cache
        names = mbeanServer.queryNames(on, null);
        assertEquals(2, names.size());

        log.info("Removing 2nd route");

        // now remove the 2nd route
View Full Code Here

        boolean removed = context.removeRoute("bar");
        assertTrue(removed);

        // the producer cache should have been removed
        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=services,name=ProducerCache*");
        names = mbeanServer.queryNames(on, null);
        assertEquals(1, names.size());

        log.info("Shutting down...");
    }

View Full Code Here

        MBeanServer mbeanServer = getMBeanServer();
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=services,name=ProducerCache*");

        // number of producer caches
        Set<ObjectName> names = mbeanServer.queryNames(on, null);
        assertEquals(1, names.size());
       
        log.info("Adding 2nd route");

        // add a 2nd route
View Full Code Here

        bar.expectedMessageCount(1);
        template.sendBodyAndHeader("direct:bar", "Hello World", "bar", "mock:bar");
        bar.assertIsSatisfied();

        // there should be one more producer cache
        names = mbeanServer.queryNames(on, null);
        assertEquals(2, names.size());

        log.info("Removing 2nd route");

        // now remove the 2nd route
View Full Code Here

        boolean removed = context.removeRoute("bar");
        assertTrue(removed);

        // the producer cache should have been removed
        on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=services,name=ProducerCache*");
        names = mbeanServer.queryNames(on, null);
        assertEquals(1, names.size());

        log.info("Shutting down...");
    }

View Full Code Here

        MBeanServer mbeanServer = getMBeanServer();
        ObjectName on = ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=services,name=ProducerCache*");

        // number of producer caches
        Set<ObjectName> names = mbeanServer.queryNames(on, null);
        assertEquals(1, names.size());

        log.info("Adding 2nd route");

        // add a 2nd route
View Full Code Here

        bar.expectedMessageCount(1);
        template.sendBodyAndHeader("direct:bar", "Hello World", "bar", "mock:bar");
        bar.assertIsSatisfied();

        // there should be one more producer cache
        names = mbeanServer.queryNames(on, null);
        assertEquals(2, names.size());

        log.info("Removing 2nd route");

        // now remove the 2nd route
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.