Java Code Examples for org.springframework.jmx.export.annotation.AnnotationMBeanExporter#setServer()

The following examples show how to use org.springframework.jmx.export.annotation.AnnotationMBeanExporter#setServer() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MBeanExportConfiguration.java    From spring-analysis-note with MIT License 6 votes vote down vote up
private void setupServer(AnnotationMBeanExporter exporter, AnnotationAttributes enableMBeanExport) {
	String server = enableMBeanExport.getString("server");
	if (StringUtils.hasLength(server) && this.environment != null) {
		server = this.environment.resolvePlaceholders(server);
	}
	if (StringUtils.hasText(server)) {
		Assert.state(this.beanFactory != null, "No BeanFactory set");
		exporter.setServer(this.beanFactory.getBean(server, MBeanServer.class));
	}
	else {
		SpecificPlatform specificPlatform = SpecificPlatform.get();
		if (specificPlatform != null) {
			MBeanServer mbeanServer = specificPlatform.getMBeanServer();
			if (mbeanServer != null) {
				exporter.setServer(mbeanServer);
			}
		}
	}
}
 
Example 2
Source File: MBeanExportConfiguration.java    From java-technology-stack with MIT License 6 votes vote down vote up
private void setupServer(AnnotationMBeanExporter exporter, AnnotationAttributes enableMBeanExport) {
	String server = enableMBeanExport.getString("server");
	if (StringUtils.hasLength(server) && this.environment != null) {
		server = this.environment.resolvePlaceholders(server);
	}
	if (StringUtils.hasText(server)) {
		Assert.state(this.beanFactory != null, "No BeanFactory set");
		exporter.setServer(this.beanFactory.getBean(server, MBeanServer.class));
	}
	else {
		SpecificPlatform specificPlatform = SpecificPlatform.get();
		if (specificPlatform != null) {
			MBeanServer mbeanServer = specificPlatform.getMBeanServer();
			if (mbeanServer != null) {
				exporter.setServer(mbeanServer);
			}
		}
	}
}
 
Example 3
Source File: MBeanExportConfiguration.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void setupServer(AnnotationMBeanExporter exporter) {
	String server = this.enableMBeanExport.getString("server");
	if (server != null && this.environment != null) {
		server = this.environment.resolvePlaceholders(server);
	}
	if (StringUtils.hasText(server)) {
		exporter.setServer(this.beanFactory.getBean(server, MBeanServer.class));
	}
	else {
		SpecificPlatform specificPlatform = SpecificPlatform.get();
		if (specificPlatform != null) {
			exporter.setServer(specificPlatform.getMBeanServer());
		}
	}
}
 
Example 4
Source File: MBeanExportConfiguration.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
private void setupServer(AnnotationMBeanExporter exporter) {
	String server = this.enableMBeanExport.getString("server");
	if (server != null && this.environment != null) {
		server = this.environment.resolvePlaceholders(server);
	}
	if (StringUtils.hasText(server)) {
		exporter.setServer(this.beanFactory.getBean(server, MBeanServer.class));
	}
	else {
		SpecificPlatform specificPlatform = SpecificPlatform.get();
		if (specificPlatform != null) {
			exporter.setServer(specificPlatform.getMBeanServer());
		}
	}
}