Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Add protected methods to Configuration so subclasses may extend it
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Hier <ihier@uber.com>
  • Loading branch information
Isaac Hier committed Aug 6, 2018
1 parent f3e5049 commit f1d1085
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions jaeger-core/src/main/java/io/jaegertracing/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ public Configuration(String serviceName) {
this.serviceName = JaegerTracer.Builder.checkValidServiceName(serviceName);
}


/**
* @return Configuration object from environmental variables
*/
Expand Down Expand Up @@ -462,7 +461,7 @@ public void apply(JaegerTracer.Builder builder) {
registerCodec(builder, Format.Builtin.TEXT_MAP);
}

protected void registerCodec(JaegerTracer.Builder builder, Format<TextMap> format) {
private void registerCodec(JaegerTracer.Builder builder, Format<TextMap> format) {
if (codecs.containsKey(format)) {
List<Codec<TextMap>> codecsForFormat = codecs.get(format);
Codec<TextMap> codec = codecsForFormat.size() == 1
Expand Down Expand Up @@ -653,19 +652,19 @@ public static SenderConfiguration fromEnv() {
}
}

private static String stringOrDefault(String value, String defaultValue) {
protected static String stringOrDefault(String value, String defaultValue) {
return value != null && value.length() > 0 ? value : defaultValue;
}

private static Number numberOrDefault(Number value, Number defaultValue) {
protected static Number numberOrDefault(Number value, Number defaultValue) {
return value != null ? value : defaultValue;
}

private static String getProperty(String name) {
protected static String getProperty(String name) {
return System.getProperty(name, System.getenv(name));
}

private static Integer getPropertyAsInt(String name) {
protected static Integer getPropertyAsInt(String name) {
String value = getProperty(name);
if (value != null) {
try {
Expand All @@ -677,7 +676,7 @@ private static Integer getPropertyAsInt(String name) {
return null;
}

private static Number getPropertyAsNum(String name) {
protected static Number getPropertyAsNum(String name) {
String value = getProperty(name);
if (value != null) {
try {
Expand All @@ -694,11 +693,11 @@ private static Number getPropertyAsNum(String name) {
* the name. This method defaults to returning false for a name that doesn't exist.
* @param name The name of the system property
*/
private static boolean getPropertyAsBool(String name) {
protected static boolean getPropertyAsBool(String name) {
return Boolean.valueOf(getProperty(name));
}

private static Map<String, String> tracerTagsFromEnv() {
protected static Map<String, String> tracerTagsFromEnv() {
Map<String, String> tracerTagMaps = null;
String tracerTags = getProperty(JAEGER_TAGS);
if (tracerTags != null) {
Expand All @@ -718,7 +717,7 @@ private static Map<String, String> tracerTagsFromEnv() {
return tracerTagMaps;
}

private static String resolveValue(String value) {
protected static String resolveValue(String value) {
if (value.startsWith("${") && value.endsWith("}")) {
String[] ref = value.substring(2, value.length() - 1).split("\\s*:\\s*");
if (ref.length > 0) {
Expand Down

0 comments on commit f1d1085

Please sign in to comment.