/** * Creates a new instance of the MetricProxy class. * * @param instance The initial Metric Instance. * @param proxyName The name of the MetricProxy. This may be different from the name of the Metric's instance. * @param closeCallback A Consumer that will be invoked when this Proxy is closed. */ MetricProxy(T instance, String proxyName, Consumer<String> closeCallback) { this.closeCallback = Preconditions.checkNotNull(closeCallback, "closeCallback"); this.proxyName = Exceptions.checkNotNullOrEmpty(proxyName, "name"); updateInstance(instance); }