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

com.hubspot.singularity.EmbeddedSingularityExample Maven / Gradle / Ivy

package com.hubspot.singularity;

import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
import com.hubspot.singularity.config.SingularityConfiguration;

import io.dropwizard.Bundle;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

/**
 * Example on how to embed Singularity into another piece of code or how to extend Singularity with additional
 * functionality that is not in the service out-of-the-box.
 *
 * The {@link SingularityService} class provides a number of extension points to hook additional functionality
 * into the service and by building a separate artifact, it is possible to package the code differently or add
 * additional runtime dependencies without having to modify the main SingularityService build itself.
 */
public class EmbeddedSingularityExample extends SingularityService {
  @Override
  public Iterable getGuiceModules(final Bootstrap bootstrap) {
    return ImmutableSet.of();
  }

  @Override
  public Iterable getDropwizardBundles(final Bootstrap bootstrap) {
    return ImmutableSet.of();
  }

  @Override
  public Iterable> getDropwizardConfiguredBundles(final Bootstrap bootstrap) {
    return ImmutableSet.of();
  }

  @Override
  public void initialize(final Bootstrap bootstrap) {
    super.initialize(bootstrap);
  }

  @Override
  public void run(final SingularityConfiguration configuration, final Environment environment) throws Exception {
    super.run(configuration, environment);
  }

  public static void main(final String[] args) throws Exception {
    new EmbeddedSingularityExample().run(args);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy