-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #401 from elandau/feature/decouple_archaius
configuration: Decouple static archaius
- Loading branch information
Showing
53 changed files
with
1,121 additions
and
1,066 deletions.
There are no files selected for viewing
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
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
755 changes: 424 additions & 331 deletions
755
ribbon-archaius/src/main/java/com/netflix/client/config/DefaultClientConfigImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
dependencies { | ||
compile 'org.slf4j:slf4j-api:1.6.4' | ||
compile "org.slf4j:slf4j-api:${slf4j_version}" | ||
compile 'com.google.code.findbugs:annotations:2.0.0' | ||
compile "com.google.guava:guava:${guava_version}" | ||
compile 'commons-lang:commons-lang:2.6' | ||
|
||
testCompile 'junit:junit:4.11' | ||
testCompile "org.slf4j:slf4j-log4j12:${slf4j_version}" | ||
testCompile project(":ribbon-archaius") | ||
} |
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
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
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
34 changes: 34 additions & 0 deletions
34
ribbon-core/src/main/java/com/netflix/client/config/Property.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.netflix.client.config; | ||
|
||
import java.util.function.Consumer; | ||
|
||
/** | ||
* Ribbon specific encapsulation of a dynamic configuration property | ||
* @param <T> | ||
*/ | ||
public interface Property<T> { | ||
/** | ||
* Register a consumer to be called when the configuration changes | ||
* @param consumer | ||
*/ | ||
void onChange(Consumer<T> consumer); | ||
|
||
/** | ||
* @return Get the current value or default value | ||
*/ | ||
T get(); | ||
|
||
static <T> Property<T> of(T value) { | ||
return new Property<T>() { | ||
@Override | ||
public void onChange(Consumer<T> consumer) { | ||
|
||
} | ||
|
||
@Override | ||
public T get() { | ||
return value; | ||
} | ||
}; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
ribbon-core/src/main/java/com/netflix/client/config/UnboxedIntProperty.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.netflix.client.config; | ||
|
||
public class UnboxedIntProperty { | ||
private volatile int value; | ||
|
||
public UnboxedIntProperty(Property<Integer> delegate) { | ||
this.value = delegate.get(); | ||
|
||
delegate.onChange(newValue -> this.value = newValue); | ||
} | ||
|
||
public UnboxedIntProperty(int constantValue) { | ||
this.value = constantValue; | ||
} | ||
|
||
public int get() { | ||
return value; | ||
} | ||
} |
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
29 changes: 0 additions & 29 deletions
29
ribbon-eureka/src/main/java/com/netflix/niws/loadbalancer/DefaultNIWSServerListFilter.java
This file was deleted.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
log4j.rootCategory=INFO,stdout | ||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=%d %-5p %C:%L [%t] [%M] %m%n |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
dependencies { | ||
compile project(':ribbon-core') | ||
compile project(':ribbon-archaius') | ||
compile project(':ribbon-loadbalancer') | ||
compile 'commons-collections:commons-collections:3.2.2' | ||
compile 'org.apache.httpcomponents:httpclient:4.2.1' | ||
compile 'com.google.code.findbugs:annotations:2.0.0' | ||
compile "com.sun.jersey:jersey-client:${jersey_version}" | ||
compile "com.sun.jersey.contribs:jersey-apache-client4:${jersey_version}" | ||
compile 'org.slf4j:slf4j-api:1.6.4' | ||
compile "org.slf4j:slf4j-api:${slf4j_version}" | ||
compile "com.netflix.servo:servo-core:${servo_version}" | ||
compile "com.google.guava:guava:${guava_version}" | ||
compile "com.netflix.archaius:archaius-core:${archaius_version}" | ||
compile 'com.netflix.netflix-commons:netflix-commons-util:0.1.1' | ||
testCompile 'junit:junit:4.11' | ||
testCompile 'org.slf4j:slf4j-log4j12:1.7.2' | ||
testCompile "org.slf4j:slf4j-log4j12:${slf4j_version}" | ||
testCompile 'commons-io:commons-io:2.0.1' | ||
testCompile "com.sun.jersey:jersey-server:${jersey_version}" | ||
testCompile 'com.google.mockwebserver:mockwebserver:20130505' | ||
testCompile project(':ribbon-archaius') | ||
testCompile project(":ribbon-loadbalancer").sourceSets.test.output | ||
} |
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
Oops, something went wrong.