All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vlingo.xoom.telemetry.TelemetryProvider Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.11.1
Show newest version
// 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> providerClass = (Class>) Class.forName(className);
      return providerClass.getDeclaredConstructor().newInstance();
    } catch (final Exception ex) {
      throw new TelemetryProvider.InvalidTelemetryProviderException(className, ex);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy