Commit acfecc38 by Spencer Gibb

renamed Hystrix and Eureka configurations

parent 3a066323
......@@ -30,7 +30,7 @@ import org.springframework.context.annotation.Import;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(EurekaClientConfiguration.class)
@Import(EurekaDiscoveryClientConfiguration.class)
@Deprecated
public @interface EnableEurekaClient {
......
......@@ -54,10 +54,10 @@ import java.util.concurrent.atomic.AtomicInteger;
@EnableConfigurationProperties
@ConditionalOnClass(EurekaClientConfig.class)
@ConditionalOnExpression("${eureka.client.enabled:true}")
public class EurekaClientConfiguration implements SmartLifecycle, Ordered {
public class EurekaDiscoveryClientConfiguration implements SmartLifecycle, Ordered {
private static final Logger logger = LoggerFactory
.getLogger(EurekaClientConfiguration.class);
.getLogger(EurekaDiscoveryClientConfiguration.class);
private AtomicBoolean running = new AtomicBoolean(false);
......@@ -162,9 +162,9 @@ public class EurekaClientConfiguration implements SmartLifecycle, Ordered {
@Override
public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) {
// TODO: take SSL into account when Spring Boot 1.2 is available
EurekaClientConfiguration.this.port.compareAndSet(0, event.getEmbeddedServletContainer()
.getPort());
EurekaClientConfiguration.this.start();
EurekaDiscoveryClientConfiguration.this.port.compareAndSet(0, event.getEmbeddedServletContainer()
.getPort());
EurekaDiscoveryClientConfiguration.this.start();
}
};
}
......
......@@ -25,7 +25,7 @@ import java.lang.annotation.*;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(HystrixConfiguration.class)
@Import(HystrixCircuitBreakerConfiguration.class)
@Deprecated
public @interface EnableHystrix {
}
\ No newline at end of file
......@@ -46,7 +46,7 @@ import java.util.Set;
* @author Christian Dupuis
*/
@Configuration
public class HystrixConfiguration {
public class HystrixCircuitBreakerConfiguration {
@Bean
public HystrixCommandAspect hystrixCommandAspect() {
......
......@@ -12,7 +12,7 @@ org.springframework.cloud.bootstrap.BootstrapConfiguration=\
org.springframework.cloud.netflix.config.DiscoveryClientConfigServiceBootstrapConfiguration
org.springframework.cloud.client.discovery.EnableDiscoveryClient=\
org.springframework.cloud.netflix.eureka.EurekaClientConfiguration
org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration
org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker=\
org.springframework.cloud.netflix.hystrix.HystrixConfiguration
\ No newline at end of file
org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration
\ No newline at end of file
......@@ -26,7 +26,7 @@ public class HystrixConfigurationTests {
@Test
public void nonWebAppStartsUp() {
new SpringApplicationBuilder(HystrixConfiguration.class).web(false).run().close();
new SpringApplicationBuilder(HystrixCircuitBreakerConfiguration.class).web(false).run().close();
}
}
......@@ -6,7 +6,7 @@ import com.netflix.turbine.plugins.PluginsFactory;
import com.netflix.turbine.streaming.servlet.TurbineStreamServlet;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.SmartLifecycle;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -17,7 +17,7 @@ import org.springframework.core.Ordered;
*/
@Configuration
@EnableConfigurationProperties
@EnableEurekaClient
@EnableDiscoveryClient
public class TurbineConfiguration implements SmartLifecycle, Ordered {
@Bean
......@@ -49,7 +49,7 @@ public class TurbineConfiguration implements SmartLifecycle, Ordered {
@Override
public void start() {
//TODO: figure out ordering, so this is already run by EurekaClientConfiguration
//TODO: figure out ordering, so this is already run by EurekaDiscoveryClientConfiguration
//DiscoveryManager.getInstance().initComponent(instanceConfig, clientConfig);
PluginsFactory.setClusterMonitorFactory(new SpringAggregatorFactory());
PluginsFactory.setInstanceDiscovery(instanceDiscovery());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment