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

su.nlq.prometheus.jmx.connection.local.LocalConnection Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
package su.nlq.prometheus.jmx.connection.local;

import org.jetbrains.annotations.NotNull;
import su.nlq.prometheus.jmx.connection.Connection;
import su.nlq.prometheus.jmx.connection.ConnectionConsumer;

import java.lang.management.ManagementFactory;
import java.util.Optional;

public final class LocalConnection extends Connection {

  public LocalConnection(@NotNull Optional name) {
    super(name);
  }

  public LocalConnection() {
    super(Optional.empty());
  }

  @Override
  public void accept(@NotNull ConnectionConsumer consumer) {
    consumer.accept(name(ManagementFactory.getRuntimeMXBean().getName()), ManagementFactory.getPlatformMBeanServer());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy