Skip to content

Instantly share code, notes, and snippets.

@chbaranowski
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chbaranowski/79cdba6ac0690d9013b3 to your computer and use it in GitHub Desktop.
Save chbaranowski/79cdba6ac0690d9013b3 to your computer and use it in GitHub Desktop.
HotReloadConfiguration Spring Boot
@Configuration
@Conditional(HotReloadConfiguration.HotReloadCondition.class)
public class HotReloadConfiguration {
public static class HotReloadCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
String hotReloadEnabledProperty = context.getEnvironment().getProperty("hotReload.enabled");
return StringUtils.equals(hotReloadEnabledProperty, "true");
}
}
@Bean
public JHipsterReloaderAutoConfiguration reloaderAutoConfiguration() {
return new JHipsterReloaderAutoConfiguration();
}
@Bean
public SpringReloader springReloader() {
return new SpringReloader();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment