Last active
August 29, 2015 14:02
-
-
Save chbaranowski/79cdba6ac0690d9013b3 to your computer and use it in GitHub Desktop.
HotReloadConfiguration Spring Boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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