Examples of MBeanExporter


Examples of org.springframework.jmx.export.MBeanExporter

  public void onSetUp() throws Exception {
    target = new JmxTestBean();
    target.setAge(100);
    target.setName("Rob Harrop");

    MBeanExporter adapter = new MBeanExporter();
    Map beans = new HashMap();
    beans.put(OBJECT_NAME, target);
    adapter.setServer(getServer());
    adapter.setBeans(beans);
    adapter.setAssembler(new ProxyTestAssembler());
    adapter.afterPropertiesSet();
  }
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

    pf.addAdvice(new NopInterceptor());
    Object proxy = pf.getProxy();

    MetadataMBeanInfoAssembler assembler = (MetadataMBeanInfoAssembler) getAssembler();

    MBeanExporter exporter = new MBeanExporter();
    exporter.setBeanFactory(getContext());
    exporter.setAssembler(assembler);

    String objectName = "spring:bean=test,proxy=true";

    Map beans = new HashMap();
    beans.put(objectName, proxy);
    exporter.setBeans(beans);
    exporter.afterPropertiesSet();

    MBeanInfo inf = getServer().getMBeanInfo(ObjectNameManager.getInstance(objectName));
    assertEquals("Incorrect number of operations", getExpectedOperationCount(), inf.getOperations().length);
    assertEquals("Incorrect number of attributes", getExpectedAttributeCount(), inf.getAttributes().length);
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

        List<Component> components = getContext().getComponents();
        if (CollectionUtils.isBlankCollection(components)) {
            return;
        }
       
        mbeanExporter = new MBeanExporter();
       
        String mbeanNamePrefix = SpyServerCoreConstant.MAIN_PACKAGE + ":type=Component";
        String spyCompoentMBeanNamePrefix = mbeanNamePrefix + ",class=SpyComopent,";
        String alertCompoentMBeanNamePrefix = mbeanNamePrefix + ",class=AlertComopent,";
        String channelAwareCompoentMBeanNamePrefix = mbeanNamePrefix + ",class=ChannelAwareComopent,";
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

  public void onSetUp() throws Exception {
    target = new JmxTestBean();
    target.setAge(100);
    target.setName("Rob Harrop");

    MBeanExporter adapter = new MBeanExporter();
    Map<String, Object> beans = new HashMap<String, Object>();
    beans.put(OBJECT_NAME, target);
    adapter.setServer(getServer());
    adapter.setBeans(beans);
    adapter.setAssembler(new ProxyTestAssembler());
    start(adapter);
  }
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

    pf.addAdvice(new NopInterceptor());
    Object proxy = pf.getProxy();

    MetadataMBeanInfoAssembler assembler = (MetadataMBeanInfoAssembler) getAssembler();

    MBeanExporter exporter = new MBeanExporter();
    exporter.setBeanFactory(getContext());
    exporter.setAssembler(assembler);

    String objectName = "spring:bean=test,proxy=true";

    Map<String, Object> beans = new HashMap<String, Object>();
    beans.put(objectName, proxy);
    exporter.setBeans(beans);
    start(exporter);

    MBeanInfo inf = getServer().getMBeanInfo(ObjectNameManager.getInstance(objectName));
    assertEquals("Incorrect number of operations", getExpectedOperationCount(), inf.getOperations().length);
    assertEquals("Incorrect number of attributes", getExpectedAttributeCount(), inf.getAttributes().length);
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

    this.context = new AnnotationConfigApplicationContext();
    this.context.setEnvironment(env);
    this.context.register(TestConfiguration.class, JmxAutoConfiguration.class);
    this.context.refresh();

    MBeanExporter mBeanExporter = this.context.getBean(MBeanExporter.class);
    assertNotNull(mBeanExporter);
    MetadataNamingStrategy naming = (MetadataNamingStrategy) ReflectionTestUtils
        .getField(mBeanExporter, "metadataNamingStrategy");
    assertEquals("my-test-domain",
        ReflectionTestUtils.getField(naming, "defaultDomain"));
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

        new RootBeanDefinition(EndpointMBeanExporter.class));
    this.context.registerBeanDefinition("endpoint1", new RootBeanDefinition(
        TestEndpoint.class));
    this.context.refresh();

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    MBeanInfo mbeanInfo = mbeanExporter.getServer().getMBeanInfo(
        getObjectName("endpoint1", this.context));
    assertNotNull(mbeanInfo);
    assertEquals(3, mbeanInfo.getOperations().length);
    assertEquals(3, mbeanInfo.getAttributes().length);
  }
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

        TestEndpoint.class));
    this.context.registerBeanDefinition("endpoint2", new RootBeanDefinition(
        TestEndpoint.class));
    this.context.refresh();

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertNotNull(mbeanExporter.getServer().getMBeanInfo(
        getObjectName("endpoint1", this.context)));
    assertNotNull(mbeanExporter.getServer().getMBeanInfo(
        getObjectName("endpoint2", this.context)));
  }
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

                "test-domain"))));
    this.context.registerBeanDefinition("endpoint1", new RootBeanDefinition(
        TestEndpoint.class));
    this.context.refresh();

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertNotNull(mbeanExporter.getServer().getMBeanInfo(
        getObjectName("test-domain", "endpoint1", false, this.context)));
  }
View Full Code Here

Examples of org.springframework.jmx.export.MBeanExporter

            new MutablePropertyValues(properties)));
    this.context.registerBeanDefinition("endpoint1", new RootBeanDefinition(
        TestEndpoint.class));
    this.context.refresh();

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertNotNull(mbeanExporter.getServer().getMBeanInfo(
        getObjectName("test-domain", "endpoint1", true, this.context)));
  }
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.