io.vlingo.xoom.telemetry.TelemetryProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xoom-telemetry Show documentation
Show all versions of xoom-telemetry Show documentation
The reactive metrics collector plugin for the VLINGO XOOM Platform, including support for VLINGO XOOM Actors, VLINGO XOOM Http, VLINGO XOOM Lattice, VLINGO XOOM Streams, and others.
// Copyright © 2012-2021 VLINGO LABS. All rights reserved.
//
// This Source Code Form is subject to the terms of the
// Mozilla Public License, v. 2.0. If a copy of the MPL
// was not distributed with this file, You can obtain
// one at https://mozilla.org/MPL/2.0/.
package io.vlingo.xoom.telemetry;
import io.vlingo.xoom.actors.World;
@FunctionalInterface
public interface TelemetryProvider {
Telemetry provideFrom(final World world);
class InvalidTelemetryProviderException extends Exception {
private static final long serialVersionUID = 1L;
InvalidTelemetryProviderException(final String className, final Throwable cause) {
super(className + " is not a valid TelemetryProvider.", cause);
}
}
@SuppressWarnings("unchecked")
static TelemetryProvider fromClass(final String className) throws TelemetryProvider.InvalidTelemetryProviderException {
try {
Class extends TelemetryProvider> providerClass = (Class extends TelemetryProvider>) Class.forName(className);
return providerClass.getDeclaredConstructor().newInstance();
} catch (final Exception ex) {
throw new TelemetryProvider.InvalidTelemetryProviderException(className, ex);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy