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
440779bc
Commit
440779bc
authored
Jun 08, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "attempt ordering of RibbonClients.defaultConfiguration's"
This reverts commit
0d468b39
.
parent
0d468b39
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
28 deletions
+6
-28
RibbonClientConfigurationRegistrar.java
...ud/netflix/ribbon/RibbonClientConfigurationRegistrar.java
+4
-5
RibbonClientSpecification.java
...ework/cloud/netflix/ribbon/RibbonClientSpecification.java
+0
-6
RibbonClients.java
...g/springframework/cloud/netflix/ribbon/RibbonClients.java
+0
-1
SpringClientFactory.java
...ngframework/cloud/netflix/ribbon/SpringClientFactory.java
+2
-16
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonClientConfigurationRegistrar.java
View file @
440779bc
...
...
@@ -39,7 +39,7 @@ public class RibbonClientConfigurationRegistrar implements ImportBeanDefinitionR
AnnotationAttributes
[]
clients
=
(
AnnotationAttributes
[])
attrs
.
get
(
"value"
);
for
(
AnnotationAttributes
client
:
clients
)
{
registerClientConfiguration
(
registry
,
getClientName
(
client
),
client
.
get
(
"configuration"
)
,
0
);
client
.
get
(
"configuration"
));
}
}
if
(
attrs
!=
null
&&
attrs
.
containsKey
(
"defaultConfiguration"
))
{
...
...
@@ -50,13 +50,13 @@ public class RibbonClientConfigurationRegistrar implements ImportBeanDefinitionR
name
=
"default."
+
metadata
.
getClassName
();
}
registerClientConfiguration
(
registry
,
name
,
attrs
.
get
(
"defaultConfiguration"
)
,
attrs
.
get
(
"defaultConfigurationOrder"
)
);
attrs
.
get
(
"defaultConfiguration"
));
}
Map
<
String
,
Object
>
client
=
metadata
.
getAnnotationAttributes
(
RibbonClient
.
class
.
getName
(),
true
);
String
name
=
getClientName
(
client
);
if
(
name
!=
null
)
{
registerClientConfiguration
(
registry
,
name
,
client
.
get
(
"configuration"
)
,
0
);
registerClientConfiguration
(
registry
,
name
,
client
.
get
(
"configuration"
));
}
}
...
...
@@ -76,12 +76,11 @@ public class RibbonClientConfigurationRegistrar implements ImportBeanDefinitionR
}
private
void
registerClientConfiguration
(
BeanDefinitionRegistry
registry
,
Object
name
,
Object
configuration
,
Object
order
)
{
Object
name
,
Object
configuration
)
{
BeanDefinitionBuilder
builder
=
BeanDefinitionBuilder
.
genericBeanDefinition
(
RibbonClientSpecification
.
class
);
builder
.
addConstructorArgValue
(
name
);
builder
.
addConstructorArgValue
(
configuration
);
builder
.
addConstructorArgValue
(
order
);
registry
.
registerBeanDefinition
(
name
+
".RibbonClientSpecification"
,
builder
.
getBeanDefinition
());
}
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonClientSpecification.java
View file @
440779bc
...
...
@@ -30,10 +30,4 @@ public class RibbonClientSpecification {
private
Class
<?>[]
configuration
;
private
int
order
;
public
Integer
order
()
{
return
order
;
}
}
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonClients.java
View file @
440779bc
...
...
@@ -42,5 +42,4 @@ public @interface RibbonClients {
Class
<?>[]
defaultConfiguration
()
default
{};
int
defaultConfigurationOrder
()
default
0
;
}
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/SpringClientFactory.java
View file @
440779bc
...
...
@@ -16,14 +16,11 @@
package
org
.
springframework
.
cloud
.
netflix
.
ribbon
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.concurrent.ConcurrentHashMap
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -128,19 +125,8 @@ public class SpringClientFactory implements DisposableBean, ApplicationContextAw
context
.
register
(
configuration
);
}
}
List
<
Entry
<
String
,
RibbonClientSpecification
>>
entries
=
new
ArrayList
<>(
this
.
configurations
.
entrySet
());
Collections
.
sort
(
entries
,
new
Comparator
<
Entry
<
String
,
RibbonClientSpecification
>>()
{
@Override
public
int
compare
(
Entry
<
String
,
RibbonClientSpecification
>
o1
,
Entry
<
String
,
RibbonClientSpecification
>
o2
)
{
return
o1
.
getValue
().
order
().
compareTo
(
o2
.
getValue
().
order
());
}
});
for
(
Entry
<
String
,
RibbonClientSpecification
>
entry
:
entries
)
{
for
(
Entry
<
String
,
RibbonClientSpecification
>
entry
:
this
.
configurations
.
entrySet
())
{
if
(
entry
.
getKey
().
startsWith
(
"default."
))
{
for
(
Class
<?>
configuration
:
entry
.
getValue
().
getConfiguration
())
{
context
.
register
(
configuration
);
...
...
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