Package org.apache.cxf.management.jmx

Examples of org.apache.cxf.management.jmx.InstrumentationManagerImpl


    @Test
    public void testManagedEndpoint() throws Exception {
        Bus bus = SpringBusFactory.getDefaultBus();
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl impl = (InstrumentationManagerImpl)im;
        assertTrue(impl.isEnabled());
        assertNotNull(impl.getMBeanServer());

        MBeanServer mbs = im.getMBeanServer();
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
                                         + ":type=Bus.Service.Endpoint,*");
        Set s = mbs.queryNames(name, null);
View Full Code Here


        SpringBusFactory factory = new SpringBusFactory();
        Bus bus = factory.createBus();
        try {
            InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
            assertNotNull(im);
            InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
            imi.setServer(ManagementFactory.getPlatformMBeanServer());
            imi.setEnabled(true);
            imi.init();

           
            Greeter greeter1 = new GreeterImpl();
            JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
            svrFactory.setAddress("http://localhost:" + SERVICE_PORT + "/Hello");
View Full Code Here

        SpringBusFactory factory = new SpringBusFactory();
        Bus bus = factory.createBus();       
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
               
        InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
        assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi",
                     imi.getJMXServiceURL());
        assertTrue(!imi.isEnabled());
        assertNull(imi.getMBeanServer());
       
        //Test that registering without an MBeanServer is a no-op
        im.register(imi, new ObjectName("org.apache.cxf:foo=bar"));                       
       
        bus.shutdown(true);
View Full Code Here

    }
   
    private void doManagedBusTest(Bus bus, String expect, String reject, int port) throws Exception {
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
        assertEquals("service:jmx:rmi:///jndi/rmi://localhost:" + port + "/jmxrmi",
                     imi.getJMXServiceURL());
        assertTrue(imi.isEnabled());
        assertNotNull(imi.getMBeanServer());

        WorkQueueManager manager = bus.getExtension(WorkQueueManager.class);
               
        MBeanServer mbs = im.getMBeanServer();     
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
View Full Code Here

        bus.getExtension(WorkQueueManager.class);
                               
        CounterRepository cr = bus.getExtension(CounterRepository.class);
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl impl = (InstrumentationManagerImpl)im;
        assertTrue(impl.isEnabled());
        assertNotNull(impl.getMBeanServer());
       
        MBeanServer mbs = im.getMBeanServer();
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
            + ":" + ManagementConstants.BUS_ID_PROP + "=cxf" + bus.hashCode() + ",*");       
       
View Full Code Here

    @Test
    public void testManagedEndpoint() throws Exception {
        Bus bus = SpringBusFactory.getDefaultBus();
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl impl = (InstrumentationManagerImpl)im;
        assertTrue(impl.isEnabled());
        assertNotNull(impl.getMBeanServer());

        MBeanServer mbs = im.getMBeanServer();
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
                                         + ":type=Bus.Service.Endpoint,*");
        Set s = mbs.queryNames(name, null);
View Full Code Here

        Bus cxf2 = null;
        try {
            context = new ClassPathXmlApplicationContext("managed-spring-twobuses2.xml");

            cxf1 = (Bus)context.getBean("cxf1");
            InstrumentationManagerImpl im1 =
                (InstrumentationManagerImpl)cxf1.getExtension(InstrumentationManager.class);
            assertNotNull("Instrumentation Manager of cxf1 should not be null", im1);
           
            assertTrue(im1.isEnabled());
            assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi", im1.getJMXServiceURL());
           
            cxf2 = (Bus)context.getBean("cxf2");
            InstrumentationManagerImpl im2 =
                (InstrumentationManagerImpl)cxf2.getExtension(InstrumentationManager.class);
            assertNotNull("Instrumentation Manager of cxf2 should not be null", im2);

            assertFalse(im2.isEnabled());
            assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi", im2.getJMXServiceURL());
           
        } finally {
            if (cxf1 != null) {
                cxf1.shutdown(true);
            }
View Full Code Here

        bus.getExtension(WorkQueueManager.class);
                               
        CounterRepository cr = bus.getExtension(CounterRepository.class);
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl impl = (InstrumentationManagerImpl)im;
        assertTrue(impl.isEnabled());
        assertNotNull(impl.getMBeanServer());
       
        MBeanServer mbs = im.getMBeanServer();
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
            + ":" + ManagementConstants.BUS_ID_PROP + "=cxf" + bus.hashCode() + ",*");       
       
View Full Code Here

    @Test
    public void testManagedEndpoint() throws Exception {
        Bus bus = SpringBusFactory.getDefaultBus();
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl impl = (InstrumentationManagerImpl)im;
        assertTrue(impl.isEnabled());
        assertNotNull(impl.getMBeanServer());

        MBeanServer mbs = im.getMBeanServer();
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
                                         + ":type=Bus.Service.Endpoint,*");
        Set<?> s = mbs.queryNames(name, null);
View Full Code Here

        SpringBusFactory factory = new SpringBusFactory();
        Bus bus = factory.createBus();
        try {
            InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
            assertNotNull(im);
            InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
            imi.setServer(ManagementFactory.getPlatformMBeanServer());
            imi.setEnabled(true);
            imi.init();

           
            Greeter greeter1 = new GreeterImpl();
            JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
            svrFactory.setAddress("http://localhost:" + SERVICE_PORT + "/Hello");
View Full Code Here

TOP

Related Classes of org.apache.cxf.management.jmx.InstrumentationManagerImpl

Copyright © 2018 www.massapicom. 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.