Package org.apache.cxf.management

Examples of org.apache.cxf.management.InstrumentationManager


    }

    public synchronized AutomaticWorkQueue getAutomaticWorkQueue() {
        if (autoQueue == null) {
            autoQueue = createAutomaticWorkQueue();
            InstrumentationManager manager = bus.getExtension(InstrumentationManager.class);
            if (null != manager) {
                try {
                    manager.register(new WorkQueueManagerImplMBeanWrapper(this));
                } catch (JMException jmex) {
                    LOG.log(Level.WARNING , jmex.getMessage(), jmex);
                }
            }
        }
View Full Code Here


    }
   
    @Test
    public void testManagedEndpoint() throws Exception {
        Bus bus = BusFactory.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);
        assertTrue(s.size() == 1);
        name = (ObjectName)s.iterator().next();
View Full Code Here

    @Test
    public void testManagedSpringBus() throws Exception {
        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

   
    @Test
    public void testManagedBusWithConfig() throws Exception {
        SpringBusFactory factory = new SpringBusFactory();
        Bus bus = factory.createBus("org/apache/cxf/systest/management/managed-spring.xml", true);
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
        assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi", imi.getJMXServiceURL());
        assertTrue(imi.isEnabled());
        assertNotNull(imi.getMBeanServer());

        WorkQueueManager manager = bus.getExtension(WorkQueueManager.class);
        manager.getAutomaticWorkQueue();
       
        MBeanServer mbs = im.getMBeanServer();       
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
                                         + ":type=WorkQueueMBean,*");
        Set s = mbs.queryNames(name, null);
        assertTrue(s.size() == 1);
        Iterator it = s.iterator();
View Full Code Here

    public void testCountersWithInstrumentationManager() throws Exception {
        // create Client with other bus
        Bus bus = BusFactory.getDefaultBus();
                               
        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() + ",*");       
       
        SOAPService service = new SOAPService();
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);
        assertTrue(s.size() == 1);
        name = (ObjectName)s.iterator().next();
View Full Code Here

    @Test
    public void testManagedSpringBus() throws Exception {
        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

   
    @Test
    public void testManagedBusWithConfig() throws Exception {
        SpringBusFactory factory = new SpringBusFactory();
        Bus bus = factory.createBus("org/apache/cxf/systest/management/managed-spring.xml", true);
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        assertNotNull(im);
        InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
        assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9916/jmxrmi", imi.getJMXServiceURL());
        assertTrue(imi.isEnabled());
        assertNotNull(imi.getMBeanServer());

        WorkQueueManager manager = bus.getExtension(WorkQueueManager.class);
        manager.getAutomaticWorkQueue();
       
        MBeanServer mbs = im.getMBeanServer();       
        ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
                                         + ":type=WorkQueueMBean,*");
        Set s = mbs.queryNames(name, null);
        assertTrue(s.size() == 1);
        Iterator it = s.iterator();
View Full Code Here

    }

    public synchronized AutomaticWorkQueue getAutomaticWorkQueue() {
        if (autoQueue == null) {
            autoQueue = createAutomaticWorkQueue();
            InstrumentationManager manager = bus.getExtension(InstrumentationManager.class);
            if (null != manager) {
                try {
                    manager.register(new WorkQueueManagerImplMBeanWrapper(this));
                } catch (JMException jmex) {
                    LOG.log(Level.WARNING , jmex.getMessage(), jmex);
                }
            }
        }
View Full Code Here

    }
   
    public Counter createCounter(ObjectName on, MessageHandlingTimeRecorder mhtr) {
        Counter counter = null;
        counter = new ResponseTimeCounter(on);
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        if (null != im) {
            try {
                im.register(counter);
            } catch (JMException e) {
                LOG.log(Level.WARNING, "INSTRUMENTATION_REGISTER_FAULT_MSG",
                        new Object[]{e});
            }
        }   
View Full Code Here

TOP

Related Classes of org.apache.cxf.management.InstrumentationManager

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.