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

com.hubspot.blazar.util.DisableWebhookOnlyBundle Maven / Gradle / Ivy

The newest version!
package com.hubspot.blazar.util;

import com.hubspot.blazar.config.BlazarConfiguration;
import io.dropwizard.Bundle;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

/**
 * A Bundle decorator that doesn't install the bundle if running in webhookOnly mode
 */
public class DisableWebhookOnlyBundle implements ConfiguredBundle {
  private final Bundle delegate;

  public DisableWebhookOnlyBundle(Bundle delegate) {
    this.delegate = delegate;
  }

  @Override
  public void initialize(Bootstrap bootstrap) {}

  @Override
  public void run(BlazarConfiguration configuration, Environment environment) throws Exception {
    if (!configuration.isWebhookOnly()) {
      delegate.run(environment);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy