Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
10d1ed38
Commit
10d1ed38
authored
Jul 29, 2014
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename CircuitBreaker* to Hystrix*
parent
88f79507
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
27 deletions
+24
-27
EurekaServerAutoConfiguration.java
...latform/netflix/eureka/EurekaServerAutoConfiguration.java
+1
-1
HystrixConfiguration.java
...mework/platform/netflix/hystrix/HystrixConfiguration.java
+9
-9
HystrixConfigurationSelector.java
...latform/netflix/hystrix/HystrixConfigurationSelector.java
+5
-5
HystrixConfigurer.java
...framework/platform/netflix/hystrix/HystrixConfigurer.java
+2
-2
EnableHystrix.java
...k/platform/netflix/hystrix/annotations/EnableHystrix.java
+4
-7
application.yml
...-platform-netflix-zuul/src/main/resources/application.yml
+3
-3
No files found.
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/eureka/EurekaServerAutoConfiguration.java
View file @
10d1ed38
...
...
@@ -73,7 +73,7 @@ public class EurekaServerAutoConfiguration implements ServletContextAware,
LoggingConfiguration
.
getInstance
().
configure
();
EurekaServerConfigurationManager
.
getInstance
()
.
setConfiguration
(
eurekaServerConfig
);
PeerAwareInstanceRegistry
.
getInstance
();
//
PeerAwareInstanceRegistry.getInstance();
applicationContext
.
publishEvent
(
new
EurekaRegistryAvailableEvent
(
eurekaServerConfig
));
}
}.
contextInitialized
(
new
ServletContextEvent
(
servletContext
));
...
...
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
circuitbreaker/CircuitBreaker
Configuration.java
→
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
hystrix/Hystrix
Configuration.java
View file @
10d1ed38
package
org
.
springframework
.
platform
.
netflix
.
circuitbreaker
;
package
org
.
springframework
.
platform
.
netflix
.
hystrix
;
import
com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.ImportAware
;
import
org.springframework.core.annotation.AnnotationAttributes
;
import
org.springframework.core.type.AnnotationMetadata
;
import
org.springframework.platform.netflix.
circuitbreaker.annotations.EnableCircuitBreaker
;
import
org.springframework.platform.netflix.
hystrix.annotations.EnableHystrix
;
import
org.springframework.platform.netflix.endpoint.HystrixStreamEndpoint
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -18,9 +18,9 @@ import java.util.Collection;
* Created by sgibb on 6/19/14.
*/
@Configuration
public
class
CircuitBreaker
Configuration
implements
ImportAware
{
public
class
Hystrix
Configuration
implements
ImportAware
{
private
AnnotationAttributes
enable
CircuitBreaker
;
private
AnnotationAttributes
enable
Hystrix
;
@Bean
HystrixCommandAspect
hystrixCommandAspect
()
{
...
...
@@ -35,14 +35,14 @@ public class CircuitBreakerConfiguration implements ImportAware {
@Override
public
void
setImportMetadata
(
AnnotationMetadata
importMetadata
)
{
this
.
enable
CircuitBreaker
=
AnnotationAttributes
.
fromMap
(
importMetadata
.
getAnnotationAttributes
(
Enable
CircuitBreaker
.
class
.
getName
(),
false
));
Assert
.
notNull
(
this
.
enable
CircuitBreaker
,
"@Enable
CircuitBreaker
is not present on importing class "
+
importMetadata
.
getClassName
());
this
.
enable
Hystrix
=
AnnotationAttributes
.
fromMap
(
importMetadata
.
getAnnotationAttributes
(
Enable
Hystrix
.
class
.
getName
(),
false
));
Assert
.
notNull
(
this
.
enable
Hystrix
,
"@Enable
Hystrix
is not present on importing class "
+
importMetadata
.
getClassName
());
}
@Autowired
(
required
=
false
)
void
setConfigurers
(
Collection
<
CircuitBreaker
Configurer
>
configurers
)
{
void
setConfigurers
(
Collection
<
Hystrix
Configurer
>
configurers
)
{
if
(
CollectionUtils
.
isEmpty
(
configurers
))
{
return
;
}
...
...
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
circuitbreaker/CircuitBreaker
ConfigurationSelector.java
→
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
hystrix/Hystrix
ConfigurationSelector.java
View file @
10d1ed38
package
org
.
springframework
.
platform
.
netflix
.
circuitbreaker
;
package
org
.
springframework
.
platform
.
netflix
.
hystrix
;
import
org.springframework.context.annotation.AdviceMode
;
import
org.springframework.context.annotation.AdviceModeImportSelector
;
import
org.springframework.context.annotation.AutoProxyRegistrar
;
import
org.springframework.platform.netflix.
circuitbreaker.annotations.EnableCircuitBreaker
;
import
org.springframework.platform.netflix.
hystrix.annotations.EnableHystrix
;
/**
* Created by sgibb on 6/19/14.
*/
public
class
CircuitBreakerConfigurationSelector
extends
AdviceModeImportSelector
<
EnableCircuitBreaker
>
{
public
class
HystrixConfigurationSelector
extends
AdviceModeImportSelector
<
EnableHystrix
>
{
/**
* The name of the AspectJ transaction management @{@code Configuration} class.
*/
p
ublic
static
final
String
TRANSACTION_ASPECT_CONFIGURATION_CLASS_NAME
=
p
rivate
static
final
String
TRANSACTION_ASPECT_CONFIGURATION_CLASS_NAME
=
"org.springframework.transaction.aspectj.AspectJTransactionManagementConfiguration"
;
@Override
protected
String
[]
selectImports
(
AdviceMode
adviceMode
)
{
switch
(
adviceMode
)
{
case
PROXY:
return
new
String
[]{
AutoProxyRegistrar
.
class
.
getName
(),
CircuitBreaker
Configuration
.
class
.
getName
()};
return
new
String
[]{
AutoProxyRegistrar
.
class
.
getName
(),
Hystrix
Configuration
.
class
.
getName
()};
case
ASPECTJ:
return
new
String
[]{
TRANSACTION_ASPECT_CONFIGURATION_CLASS_NAME
};
default
:
...
...
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
circuitbreaker/CircuitBreaker
Configurer.java
→
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
hystrix/Hystrix
Configurer.java
View file @
10d1ed38
package
org
.
springframework
.
platform
.
netflix
.
circuitbreaker
;
package
org
.
springframework
.
platform
.
netflix
.
hystrix
;
/**
* Created by sgibb on 6/19/14.
*/
public
interface
CircuitBreaker
Configurer
{
public
interface
Hystrix
Configurer
{
}
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
circuitbreaker/annotations/EnableCircuitBreaker
.java
→
spring-platform-netflix-core/src/main/java/org/springframework/platform/netflix/
hystrix/annotations/EnableHystrix
.java
View file @
10d1ed38
package
org
.
springframework
.
platform
.
netflix
.
circuitbreaker
.
annotations
;
package
org
.
springframework
.
platform
.
netflix
.
hystrix
.
annotations
;
import
org.springframework.context.annotation.AdviceMode
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.core.Ordered
;
import
org.springframework.platform.netflix.
circuitbreaker.CircuitBreaker
ConfigurationSelector
;
import
org.springframework.platform.netflix.
hystrix.Hystrix
ConfigurationSelector
;
import
java.lang.annotation.*
;
...
...
@@ -13,9 +13,8 @@ import java.lang.annotation.*;
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Import
(
CircuitBreakerConfigurationSelector
.
class
)
public
@interface
EnableCircuitBreaker
{
@Import
(
HystrixConfigurationSelector
.
class
)
public
@interface
EnableHystrix
{
/**
* Indicate whether subclass-based (CGLIB) proxies are to be created ({@code true}) as
* opposed to standard Java interface-based proxies ({@code false}). The default is
...
...
@@ -43,5 +42,4 @@ public @interface EnableCircuitBreaker {
* The default is {@link org.springframework.core.Ordered#LOWEST_PRECEDENCE}.
*/
int
order
()
default
Ordered
.
LOWEST_PRECEDENCE
;
}
\ No newline at end of file
spring-platform-netflix-zuul/src/main/resources/application.yml
View file @
10d1ed38
...
...
@@ -39,9 +39,9 @@ eureka:
us-east-1
:
availabilityZones
:
default
serviceUrl
:
default
:
http://localhost:8080/eureka/v2/
defaultZone
:
http://localhost:8080/eureka/v2/
#
serviceUrl:
#
default: http://localhost:8080/eureka/v2/
#
defaultZone: http://localhost:8080/eureka/v2/
instance
:
#Virtual host name by which the clients identifies this service
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment