001/*
002 * Copyright 2013 Prometheus Team Licensed under the Apache License, Version 2.0
003 * (the "License"); you may not use this file except in compliance with the
004 * License. You may obtain a copy of the License at
005 *
006 * http://www.apache.org/licenses/LICENSE-2.0
007 *
008 * Unless required by applicable law or agreed to in writing, software
009 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
010 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
011 * License for the specific language governing permissions and limitations under
012 * the License.
013 */
014
015package io.prometheus.client.examples.jvmstat;
016
017
018import com.google.inject.Guice;
019import com.google.inject.Inject;
020import com.google.inject.Injector;
021import com.google.inject.Singleton;
022
023
024/**
025 * <p>Provide an example of using the jvmstat support classes.</p>
026 *
027 * <p>
028 * This example builds strongly on the one found in the <em>guice</em> workflow in that it adds
029 * an extra {@link Prometheus.ExpositionHook} through the use of a {@link
030 * com.google.inject.multibindings.Multibinder} found in {@link
031 * io.prometheus.client.examples.jvmstat.Module}.
032 * </p>
033 *
034 * @see Module
035 * @author matt.proud@gmail.com (Matt T. Proud)
036 */
037@Singleton
038public class Main {
039  public static void main(final String[] arguments) {
040    final Injector injector = Guice.createInjector(
041        new io.prometheus.client.examples.guice.Module(), new Module());
042    final io.prometheus.client.examples.guice.Main main = injector.getInstance(
043        io.prometheus.client.examples.guice.Main.class);
044
045    main.run();
046  }
047}
048