org.mapfish.print.metrics.JmxMetricsReporter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of print-lib Show documentation
Show all versions of print-lib Show documentation
Library for generating PDFs and images from online webmapping services
package org.mapfish.print.metrics;
import com.codahale.metrics.JmxReporter;
import com.codahale.metrics.MetricRegistry;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
/**
* This bean will enable JMX reporting when added to application context.
*/
public final class JmxMetricsReporter {
@Autowired
private MetricRegistry metricRegistry;
private JmxReporter reporter;
/**
* Add jmx reporter on startup.
*/
@PostConstruct
public void init() {
this.reporter = JmxReporter.forRegistry(this.metricRegistry).build();
this.reporter.start();
}
/**
* Stop JMX reporter.
*/
@PreDestroy
public void destroy() {
this.reporter.stop();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy