@Override
  public synchronized <T extends Metric> T register(String name, T metric)
      throws IllegalArgumentException {
    if(!(metric instanceof ContextAwareMetric)) {
      throw new UnsupportedOperationException("Can only register ContextAwareMetrics.");
    }
    return this.innerMetricContext.register(name, metric);
  }
@ Override public synchronized < T extends Metric > T register ( String name , T metric ) throws IllegalArgumentException { if ( ! ( metric instanceof ContextAwareMetric ) ) { throw new UnsupportedOperationException ( "Can only register ContextAwareMetrics." ) ; } return this . innerMetricContext . register ( name , metric ) ; }
Register a given metric under a given name.

<p>
This method does not support registering {@link com.codahale.metrics.MetricSet}s.
See{@link #registerAll(com.codahale.metrics.MetricSet)}.
</p>

<p>
This method will not register a metric with the same name in the parent context (if it exists).
</p>