Permalink
Browse files

Revert "If jmx-reporter isn't provided with a metrics registry, use t…

…he default."

This reverts commit 6191e22.
It turns out a JmxReporter is always created for the default metrics registry.
  • Loading branch information...
1 parent df6f8ef commit 4e04e3029f9b86e07541606c067b70e4022084a9 @ryantenney ryantenney committed Mar 1, 2012
View
9 ...pring/src/main/java/com/yammer/metrics/spring/config/JmxReporterBeanDefinitionParser.java
@@ -2,10 +2,8 @@
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
-import org.springframework.util.StringUtils;
import org.w3c.dom.Element;
-import com.yammer.metrics.Metrics;
import com.yammer.metrics.spring.JmxReporterFactory;
public class JmxReporterBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
@@ -23,12 +21,7 @@ protected boolean shouldGenerateIdAsFallback() {
@Override
protected void doParse(Element element, BeanDefinitionBuilder builder) {
builder.setFactoryMethod("createInstance");
- String registry = element.getAttribute("metrics-registry");
- if (StringUtils.hasText(registry)) {
- builder.addConstructorArgReference(registry);
- } else {
- builder.addConstructorArgValue(Metrics.defaultRegistry());
- }
+ builder.addConstructorArgReference(element.getAttribute("metrics-registry"));
}
}
View
2 metrics-spring/src/main/resources/com/yammer/metrics/spring/config/metrics.xsd
@@ -32,7 +32,7 @@
<xsd:element name="jmx-reporter">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="optional"/>
- <xsd:attribute name="metrics-registry" type="xsd:string" use="optional"/>
+ <xsd:attribute name="metrics-registry" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>

0 comments on commit 4e04e30

Please sign in to comment.