Skip to content

Instantly share code, notes, and snippets.

@rafaelbrizola
Created August 10, 2020 09:06
Show Gist options
  • Save rafaelbrizola/2a1637bf1ebec04764cf0c32d5f83a12 to your computer and use it in GitHub Desktop.
Save rafaelbrizola/2a1637bf1ebec04764cf0c32d5f83a12 to your computer and use it in GitHub Desktop.
Dropwizard ConfiguredBundle interface
/**
* A reusable bundle of functionality, used to define blocks of application behavior that are
* conditional on configuration parameters.
*
* @param <T> the required configuration interface
*/
public interface ConfiguredBundle<T> {
/**
* Initializes the environment.
*
* @param configuration the configuration object
* @param environment the application's {@link Environment}
* @throws Exception if something goes wrong
*/
default void run(T configuration, Environment environment) throws Exception {
// Do nothing
}
/**
* Initializes the application bootstrap.
*
* @param bootstrap the application bootstrap
*/
default void initialize(Bootstrap<?> bootstrap) {
// Do nothing
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment