Created
May 24, 2018 13:53
-
-
Save mykidong/3af2b6e35c51fd5988259dfa3c58a343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.codahale.metrics.MetricRegistry; | |
import org.springframework.beans.factory.FactoryBean; | |
import org.springframework.beans.factory.InitializingBean; | |
public class MetricRegistryFactory implements InitializingBean, FactoryBean<MetricRegistry> { | |
private MetricRegistry metricRegistry; | |
@Override | |
public void afterPropertiesSet() throws Exception { | |
this.metricRegistry = new MetricRegistry(); | |
} | |
@Override | |
public MetricRegistry getObject() throws Exception { | |
return this.metricRegistry; | |
} | |
@Override | |
public Class<?> getObjectType() { | |
return this.metricRegistry.getClass(); | |
} | |
@Override | |
public boolean isSingleton() { | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.