class DefaultObjectNameFactory implements ObjectNameFactory {

	private static final Logger LOGGER = LoggerFactory.getLogger(DefaultObjectNameFactory.class);

	@Override
	public ObjectName createName(String type, String domain, MetricName metricName) {<FILL_FUNCTION_BODY>}

}

	    String name = metricName.getKey();
		try {
			ObjectName objectName = new ObjectName(domain, "name", name);
			if (objectName.isPattern()) {
				objectName = new ObjectName(domain, "name", ObjectName.quote(name));
			}
			return objectName;
		} catch (MalformedObjectNameException e) {
			try {
				return new ObjectName(domain, "name", ObjectName.quote(name));
			} catch (MalformedObjectNameException e1) {
				LOGGER.warn("Unable to register {} {}", type, name, e1);
				throw new RuntimeException(e1);
			}
		}
	
<no_super_class>