Search in sources :

Example 1 with MBeanServerFactoryBean

use of org.springframework.jmx.support.MBeanServerFactoryBean in project spring-integration by spring-projects.

the class NotificationListeningMessageProducerTests method setup.

@Before
public void setup() throws Exception {
    MBeanServerFactoryBean serverFactoryBean = new MBeanServerFactoryBean();
    serverFactoryBean.setLocateExistingServerIfPossible(true);
    serverFactoryBean.afterPropertiesSet();
    this.server = serverFactoryBean.getObject();
    MBeanExporter exporter = new MBeanExporter();
    exporter.setAutodetect(false);
    exporter.afterPropertiesSet();
    this.objectName = ObjectNameManager.getInstance("si:name=numberHolder");
    exporter.registerManagedResource(this.numberHolder, this.objectName);
}
Also used : MBeanServerFactoryBean(org.springframework.jmx.support.MBeanServerFactoryBean) MBeanExporter(org.springframework.jmx.export.MBeanExporter) Before(org.junit.Before)

Example 2 with MBeanServerFactoryBean

use of org.springframework.jmx.support.MBeanServerFactoryBean in project spring-boot by spring-projects.

the class JmxAutoConfiguration method mbeanServer.

@Bean
@ConditionalOnMissingBean
public MBeanServer mbeanServer() {
    MBeanServerFactoryBean factory = new MBeanServerFactoryBean();
    factory.setLocateExistingServerIfPossible(true);
    factory.afterPropertiesSet();
    return factory.getObject();
}
Also used : MBeanServerFactoryBean(org.springframework.jmx.support.MBeanServerFactoryBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) MBeanServerFactoryBean(org.springframework.jmx.support.MBeanServerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with MBeanServerFactoryBean

use of org.springframework.jmx.support.MBeanServerFactoryBean in project spring-integration by spring-projects.

the class AttributePollingMessageSourceTests method setup.

@Before
public void setup() throws Exception {
    MBeanServerFactoryBean factoryBean = new MBeanServerFactoryBean();
    factoryBean.setLocateExistingServerIfPossible(true);
    factoryBean.afterPropertiesSet();
    this.server = factoryBean.getObject();
    this.server.registerMBean(this.counter, ObjectNameManager.getInstance("test:name=counter"));
}
Also used : MBeanServerFactoryBean(org.springframework.jmx.support.MBeanServerFactoryBean) Before(org.junit.Before)

Example 4 with MBeanServerFactoryBean

use of org.springframework.jmx.support.MBeanServerFactoryBean in project spring-integration by spring-projects.

the class MBeanTreePollingMessageSourceTests method setup.

@Before
public void setup() {
    MBeanServerFactoryBean factoryBean = new MBeanServerFactoryBean();
    factoryBean.setLocateExistingServerIfPossible(true);
    factoryBean.afterPropertiesSet();
    this.server = factoryBean.getObject();
}
Also used : MBeanServerFactoryBean(org.springframework.jmx.support.MBeanServerFactoryBean) Before(org.junit.Before)

Example 5 with MBeanServerFactoryBean

use of org.springframework.jmx.support.MBeanServerFactoryBean in project spring-integration by spring-projects.

the class OperationInvokingMessageHandlerTests method setup.

@Before
public void setup() throws Exception {
    MBeanServerFactoryBean factoryBean = new MBeanServerFactoryBean();
    factoryBean.setLocateExistingServerIfPossible(true);
    factoryBean.afterPropertiesSet();
    this.server = factoryBean.getObject();
    this.server.registerMBean(new TestOps(), ObjectNameManager.getInstance(this.objectName));
}
Also used : MBeanServerFactoryBean(org.springframework.jmx.support.MBeanServerFactoryBean) Before(org.junit.Before)

Aggregations

MBeanServerFactoryBean (org.springframework.jmx.support.MBeanServerFactoryBean)5 Before (org.junit.Before)4 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1 MBeanExporter (org.springframework.jmx.export.MBeanExporter)1