Package org.apache.cxf.management

Examples of org.apache.cxf.management.InstrumentationManager


    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();
        assertNotNull(service);       
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 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(), 9917);
    }
   
    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

    public void setBus(Bus bus) {
        if (this.bus == null) {
            readJMXProperties(bus);
        } else {
            // possibly this bus was reassigned from another im bean
            InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
            if (this != im) {
                bus.setExtension(this, InstrumentationManager.class);
                try {
                    ManagedBus mbus = new ManagedBus(bus);
                    im.unregister(mbus);
                    if (LOG.isLoggable(Level.INFO)) {
                        LOG.info("unregistered " + mbus.getObjectName());
                    }
                } catch (JMException e) {
                    // ignore
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

        prepareClient();
       
        RMManager clientManager = clientBus.getExtension(RMManager.class);
        RMManager serverManager = serverBus.getExtension(RMManager.class);
       
        InstrumentationManager serverIM = serverBus.getExtension(InstrumentationManager.class);
        MBeanServer mbs = serverIM.getMBeanServer();
        assertNotNull("MBeanServer must be available.", mbs);

        ObjectName clientManagerName = RMUtils.getManagedObjectName(clientManager);
        ObjectName serverManagerName = RMUtils.getManagedObjectName(serverManager);
View Full Code Here

        prepareClient();
       
        RMManager clientManager = clientBus.getExtension(RMManager.class);
        RMManager serverManager = serverBus.getExtension(RMManager.class);
       
        InstrumentationManager serverIM = serverBus.getExtension(InstrumentationManager.class);
        MBeanServer mbs = serverIM.getMBeanServer();
        assertNotNull("MBeanServer must be available.", mbs);
   
        ObjectName clientManagerName = RMUtils.getManagedObjectName(clientManager);
        ObjectName serverManagerName = RMUtils.getManagedObjectName(serverManager);
   
View Full Code Here

    public void testSuspendAndResumeSourceSequence() throws Exception {
        prepareClient();
       
        RMManager clientManager = clientBus.getExtension(RMManager.class);
       
        InstrumentationManager serverIM = serverBus.getExtension(InstrumentationManager.class);
        MBeanServer mbs = serverIM.getMBeanServer();
        assertNotNull("MBeanServer must be available.", mbs);

        Object o;
        GreeterService gs = new GreeterService();
        final Greeter greeter = gs.getGreeterPort();
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.