Package org.apache.cxf.management

Examples of org.apache.cxf.management.InstrumentationManager


       
        Configurer configurer = new ConfigurerImpl();
        bus.getExtension(Configurer.class);
        EasyMock.expectLastCall().andReturn(configurer).anyTimes();
       
        InstrumentationManager iManager = control.createMock(InstrumentationManager.class);
        iManager.getMBeanServer();
        EasyMock.expectLastCall().andReturn(ManagementFactory.getPlatformMBeanServer()).anyTimes();
       
        bus.getExtension(InstrumentationManager.class);
        EasyMock.expectLastCall().andReturn(iManager).anyTimes();
       
View Full Code Here


    @Test
    public void testTwoSameNamedEndpoint() throws Exception {
        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");
            svrFactory.setServiceBean(greeter1);
            svrFactory.getProperties(true).put("managed.endpoint.name", "greeter1");
            svrFactory.create();

            Greeter greeter2 = new GreeterImpl();
            svrFactory = new JaxWsServerFactoryBean();
            svrFactory.setAddress("http://localhost:" + SERVICE_PORT + "/Hello2");
            svrFactory.setServiceBean(greeter2);
            svrFactory.getProperties(true).put("managed.endpoint.name", "greeter2");
            svrFactory.create();
           
            MBeanServer mbs = im.getMBeanServer();
           
            ObjectName name = new ObjectName(ManagementConstants.DEFAULT_DOMAIN_NAME
                                             + ":type=Bus.Service.Endpoint,*");
            Set s = mbs.queryMBeans(name, null);
            assertEquals(2, s.size());
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

        Bus bus = factory.createBus("org/apache/cxf/systest/management/persistent-id.xml", true);
        doManagedBusTest(bus, "cxf_managed_bus_test", bus.getId(), Integer.parseInt(JMX_PORT2));
    }
   
    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
                                         + ":type=WorkQueueManager,*");
        Set s = mbs.queryNames(name, null);
        StringBuilder b = new StringBuilder();
        for (ObjectName o : CastUtils.cast(s, ObjectName.class)) {
View Full Code Here

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

       
        Configurer configurer = new ConfigurerImpl();
        bus.getExtension(Configurer.class);
        EasyMock.expectLastCall().andReturn(configurer).anyTimes();
       
        InstrumentationManager iManager = control.createMock(InstrumentationManager.class);
        iManager.getMBeanServer();
        EasyMock.expectLastCall().andReturn(ManagementFactory.getPlatformMBeanServer()).anyTimes();
       
        bus.getExtension(InstrumentationManager.class);
        EasyMock.expectLastCall().andReturn(iManager).anyTimes();
       
View Full Code Here

        this.identityMapper = identityMapper;
       
        bus = b;
        if (bus != null) {
            b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this);
            InstrumentationManager im = b.getExtension(InstrumentationManager.class);
            if (im != null) {
                try {
                    im.register(this);
                } catch (JMException e) {
                    LOG.log(Level.WARNING, "Registering EHCacheIdentityCache failed.", e);
                }
            }
        }
View Full Code Here

       
        Configurer configurer = new ConfigurerImpl();
        bus.getExtension(Configurer.class);
        EasyMock.expectLastCall().andReturn(configurer).anyTimes();
       
        InstrumentationManager iManager = control.createMock(InstrumentationManager.class);
        iManager.getMBeanServer();
        EasyMock.expectLastCall().andReturn(ManagementFactory.getPlatformMBeanServer()).anyTimes();
       
        bus.getExtension(InstrumentationManager.class);
        EasyMock.expectLastCall().andReturn(iManager).anyTimes();
       
View Full Code Here

       
        Configurer configurer = new ConfigurerImpl();
        bus.getExtension(Configurer.class);
        EasyMock.expectLastCall().andReturn(configurer).anyTimes();
       
        InstrumentationManager iManager = control.createMock(InstrumentationManager.class);
        iManager.getMBeanServer();
        EasyMock.expectLastCall().andReturn(ManagementFactory.getPlatformMBeanServer()).anyTimes();
       
        bus.getExtension(InstrumentationManager.class);
        EasyMock.expectLastCall().andReturn(iManager).anyTimes();
       
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.