当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationMBeanExporter类代码示例

本文整理汇总了Java中org.springframework.jmx.export.annotation.AnnotationMBeanExporter的典型用法代码示例。如果您正苦于以下问题:Java AnnotationMBeanExporter类的具体用法?Java AnnotationMBeanExporter怎么用?Java AnnotationMBeanExporter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AnnotationMBeanExporter类属于org.springframework.jmx.export.annotation包,在下文中一共展示了AnnotationMBeanExporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PdhIISWebServices

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhIISWebServices(
  final PerfmonQueryService perfmon,
  final GaugeService gauges,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  for(final String instance : perfmon.getInstances(WEB_SERVICE)) {
    exporter.registerManagedResource(new PdhWSByteMetrics(perfmon, gauges, instance), getObjectName("IO", instance));
    exporter.registerManagedResource(new PdhWSCGIMetrics(perfmon, gauges, instance), getObjectName("CGI", instance));
    exporter.registerManagedResource(new PdhWSConnectionMetrics(perfmon, gauges, instance), getObjectName("Connection", instance));
    exporter.registerManagedResource(new PdhWSErrorMetrics(perfmon, gauges, instance), getObjectName("Error", instance));
    exporter.registerManagedResource(new PdhWSFileMetrics(perfmon, gauges, instance), getObjectName("File", instance));
    exporter.registerManagedResource(new PdhWSRequestMetrics(perfmon, gauges, instance), getObjectName("Request", instance));
    exporter.registerManagedResource(new PdhWSUserMetrics(perfmon, gauges, instance), getObjectName("User", instance));
    exporter.registerManagedResource(new PdhWSMiscMetrics(perfmon, instance), getObjectName("Misc", instance));
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:18,代码来源:PdhIISWebServices.java

示例2: mbeanExporter

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
@Bean(name=MBEAN_EXPORTER_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public AnnotationMBeanExporter mbeanExporter() {
	AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
	setupDomain(exporter);
	setupServer(exporter);
	setupRegistrationPolicy(exporter);
	return exporter;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:MBeanExportConfiguration.java

示例3: setupDomain

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
private void setupDomain(AnnotationMBeanExporter exporter) {
	String defaultDomain = this.attributes.getString("defaultDomain");
	if (defaultDomain != null && this.environment != null) {
		defaultDomain = this.environment.resolvePlaceholders(defaultDomain);
	}
	if (StringUtils.hasText(defaultDomain)) {
		exporter.setDefaultDomain(defaultDomain);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:MBeanExportConfiguration.java

示例4: setupServer

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
private void setupServer(AnnotationMBeanExporter exporter) {
	String server = this.attributes.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());
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:MBeanExportConfiguration.java

示例5: parseInternal

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
@Override
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
	BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(AnnotationMBeanExporter.class);

	// Mark as infrastructure bean and attach source location.
	builder.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	builder.getRawBeanDefinition().setSource(parserContext.extractSource(element));

	String defaultDomain = element.getAttribute(DEFAULT_DOMAIN_ATTRIBUTE);
	if (StringUtils.hasText(defaultDomain)) {
		builder.addPropertyValue("defaultDomain", defaultDomain);
	}

	String serverBeanName = element.getAttribute(SERVER_ATTRIBUTE);
	if (StringUtils.hasText(serverBeanName)) {
		builder.addPropertyReference("server", serverBeanName);
	}
	else {
		AbstractBeanDefinition specialServer = MBeanServerBeanDefinitionParser.findServerForSpecialEnvironment();
		if (specialServer != null) {
			builder.addPropertyValue("server", specialServer);
		}
	}

	String registration = element.getAttribute(REGISTRATION_ATTRIBUTE);
	RegistrationPolicy registrationPolicy = RegistrationPolicy.FAIL_ON_EXISTING;
	if (REGISTRATION_IGNORE_EXISTING.equals(registration)) {
		registrationPolicy = RegistrationPolicy.IGNORE_EXISTING;
	}
	else if (REGISTRATION_REPLACE_EXISTING.equals(registration)) {
		registrationPolicy = RegistrationPolicy.REPLACE_EXISTING;
	}
	builder.addPropertyValue("registrationPolicy", registrationPolicy);

	return builder.getBeanDefinition();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:MBeanExportBeanDefinitionParser.java

示例6: PdhSqlServerPlanCaches

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhSqlServerPlanCaches(
  final PerfmonQueryService perfmon,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  for(final String instance : perfmon.getInstances(SQL_SERVER + ":" + PLAN_CACHE)) {
    final ObjectName objectName = new ObjectName(String.format(OBJECT_NAME, quote(instance)));
    final PdhSqlServerPlanCacheMetrics metric = new PdhSqlServerPlanCacheMetrics(perfmon, instance);
    exporter.registerManagedResource(metric, objectName);
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:12,代码来源:PdhSqlServerPlanCaches.java

示例7: PdhSqlServerLocks

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhSqlServerLocks(
  final PerfmonQueryService perfmon,
  final GaugeService gauges,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  for(final String instance : perfmon.getInstances(SQL_SERVER + ":" + LOCKS)) {
    final ObjectName objectName = new ObjectName(String.format(OBJECT_NAME, LOCKS, quote(instance)));
    final PdhSqlServerLocksMetrics metric = new PdhSqlServerLocksMetrics(instance, perfmon, gauges);
    exporter.registerManagedResource(metric, objectName);
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:13,代码来源:PdhSqlServerLocks.java

示例8: PdhSqlServerDatabases

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhSqlServerDatabases(
  final PerfmonQueryService perfmon,
  final GaugeService gauges,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  for(final String instance : perfmon.getInstances(SQL_SERVER_DATABASES)) {
    final ObjectName objectName = new ObjectName(String.format(OBJECT_NAME, DATABASES, quote(instance)));
    final PdhSqlServerDatabaseMetrics metric = new PdhSqlServerDatabaseMetrics(perfmon, gauges, instance);
    exporter.registerManagedResource(metric, objectName);
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:13,代码来源:PdhSqlServerDatabases.java

示例9: PdhProcesses

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhProcesses(
  final PerfmonQueryService perfmon,
  final GaugeService gauges,
  final WindowsSystemMetrics system,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  for (final String instance : perfmon.getInstances(PROCESS)) {
    final ObjectName objectName = new ObjectName(format(OBJECT_NAME, PROCESS, quote(instance)));
    final WindowsProcessMetrics metric = new PdhProcessMetrics(perfmon, gauges, instance, system);
    exporter.registerManagedResource(metric, objectName);
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:14,代码来源:PdhProcesses.java

示例10: PdhPhysicalDisks

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhPhysicalDisks(
    final PerfmonQueryService perfmon,
    final GaugeService gauges,
    final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  final List<String> instances = perfmon.getInstances(PHYSICAL_DISK);
  log.info("Physical Disks: " + instances);
  for(final String instance: instances) {
    final ObjectName objectName = new ObjectName(format(OBJECT_NAME, PHYSICAL_DISK, quote(instance)));
    final WindowsPhysicalDiskMetrics metric = new PdhPhysicalDiskMetrics(perfmon, gauges, instance);
    exporter.registerManagedResource(metric, objectName);
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:15,代码来源:PdhPhysicalDisks.java

示例11: PdhProcessors

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhProcessors(
  final PerfmonQueryService perfmon,
  final GaugeService gauges,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  for(final String instance: perfmon.getInstances(PROCESSOR)) {
    final ObjectName objectName = new ObjectName(format(OBJECT_NAME, PROCESSOR, quote(instance)));
    final PdhProcessorMetrics metric = new PdhProcessorMetrics(perfmon, gauges, instance);
    exporter.registerManagedResource(metric, objectName);
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:13,代码来源:PdhProcessors.java

示例12: PdhNetworkInterfaces

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhNetworkInterfaces(
  final PerfmonQueryService perfmon,
  final GaugeService gauges,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  final List<String> instances = perfmon.getInstances(IFACE);
  log.info("Network Interfaces: " + instances);
  for(final String instance: instances) {
    final ObjectName objectName = new ObjectName(format(OBJECT_NAME, quote(instance)));
    final WindowsNetworkInterfaceMetrics metric = new PdhNetworkInterfaceMetrics(perfmon, gauges, instance);
    exporter.registerManagedResource(metric, objectName);
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:15,代码来源:PdhNetworkInterfaces.java

示例13: PdhASPDotNetApps

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
PdhASPDotNetApps(
  final PerfmonQueryService perfmon,
  final GaugeService gauges,
  final AnnotationMBeanExporter exporter) throws Win32Exception, JMException {
  super();

  for(final String instance : perfmon.getInstances(ASP_DOT_NET_APPS)) {
    exporter.registerManagedResource(new PdhASPDotNetAppMetrics(perfmon, gauges, instance), getObjectName(instance));
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:11,代码来源:PdhASPDotNetApps.java

示例14: NetworkInterfaces

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
NetworkInterfaces(
  final UnitConversionService units,
  final CachingService caching,
  final Sigar sigar,
  final AnnotationMBeanExporter server) throws SigarException, JMException {
  super();

  for(final String iface : ImmutableSet.copyOf(sigar.getNetInterfaceList())) {
    final NetInterfaceConfig config = sigar.getNetInterfaceConfig(iface);
    final Try.CheckedSupplier<NetInterfaceStat> stats = caching
      .cache(() -> sigar.getNetInterfaceStat(iface));
    final String name = config.getName();
    final NetworkInterfaceMetrics info = SigarNetworkInterfaceMetrics
      .builder()
      .name(name)
      .stats(stats)
      .units(units)
      .build();
    server.registerManagedResource(info, new ObjectName(format(OBJECT_NAME, ObjectName.quote(name))));
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:22,代码来源:NetworkInterfaces.java

示例15: Processes

import org.springframework.jmx.export.annotation.AnnotationMBeanExporter; //导入依赖的package包/类
Processes(
  final UnitConversionService units,
  final CachingService caching,
  final Sigar sigar,
  final AnnotationMBeanExporter server) throws SigarException, JMException {
  super();

  for(final long pid : sigar.getProcList()) {
    try {
      final ProcState state = sigar.getProcState(pid);
      final String name = state.getName();

      final SigarProcessMetrics process = SigarProcessMetrics
        .builder()
        .units(units)
        .name(name)
        .pid(pid)
        .cpu(caching.cache(() -> sigar.getProcCpu(pid)))
        .memory(caching.cache(() -> sigar.getProcMem(pid)))
        .build();

      server.registerManagedResource(process, new ObjectName(format(OBJECT_NAME, name, pid)));
    } catch(final SigarException e) {
      // Process disappeared between listing and proc state
    }
  }
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:28,代码来源:Processes.java


注:本文中的org.springframework.jmx.export.annotation.AnnotationMBeanExporter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。