forked from elastic/apm-agent-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
elastic#3030: Introduce configuration API within SPI package that act…
…s as a binary compatible mirror of the current configuration.
- Loading branch information
Showing
67 changed files
with
756 additions
and
174 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
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
48 changes: 48 additions & 0 deletions
48
...gent-core/src/main/java/co/elastic/apm/agent/configuration/converter/WildcardMatcher.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,48 @@ | ||
package co.elastic.apm.agent.configuration.converter; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class WildcardMatcher extends co.elastic.apm.agent.common.util.WildcardMatcher implements co.elastic.apm.plugin.spi.WildcardMatcher { | ||
|
||
private static final WildcardMatcher MATCH_ALL = new WildcardMatcher(co.elastic.apm.agent.common.util.WildcardMatcher.matchAll()); | ||
private static final List<WildcardMatcher> MATCH_ALL_LIST = Collections.singletonList(MATCH_ALL); | ||
|
||
private final co.elastic.apm.agent.common.util.WildcardMatcher matcher; | ||
|
||
public WildcardMatcher(co.elastic.apm.agent.common.util.WildcardMatcher matcher) { | ||
this.matcher = matcher; | ||
} | ||
|
||
public static WildcardMatcher valueOf(String wildcardString) { | ||
return new WildcardMatcher(co.elastic.apm.agent.common.util.WildcardMatcher.valueOf(wildcardString)); | ||
} | ||
|
||
public static WildcardMatcher caseSensitiveMatcher(String matcher) { | ||
return new WildcardMatcher(co.elastic.apm.agent.common.util.WildcardMatcher.caseSensitiveMatcher(matcher)); | ||
} | ||
|
||
public static WildcardMatcher matchAll() { | ||
return MATCH_ALL; | ||
} | ||
|
||
public static List<WildcardMatcher> matchAllList() { | ||
return MATCH_ALL_LIST; | ||
} | ||
|
||
@Override | ||
public boolean matches(CharSequence s) { | ||
return matcher.matches(s); | ||
} | ||
|
||
@Override | ||
public boolean matches(CharSequence firstPart, @Nullable CharSequence secondPart) { | ||
return matcher.matches(firstPart, secondPart); | ||
} | ||
|
||
@Override | ||
public String getMatcher() { | ||
return matcher.getMatcher(); | ||
} | ||
} |
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
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
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
15 changes: 15 additions & 0 deletions
15
apm-agent-plugin-spi/src/main/java/co/elastic/apm/plugin/spi/CoreConfiguration.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,15 @@ | ||
package co.elastic.apm.plugin.spi; | ||
|
||
import java.util.List; | ||
|
||
public interface CoreConfiguration { | ||
boolean isEnablePublicApiAnnotationInheritance(); | ||
|
||
boolean isCaptureHeaders(); | ||
|
||
List<? extends WildcardMatcher> getSanitizeFieldNames(); | ||
|
||
boolean isCaptureBody(); | ||
|
||
boolean isInstrumentationEnabled(String instrumentationGroupName); | ||
} |
23 changes: 23 additions & 0 deletions
23
apm-agent-plugin-spi/src/main/java/co/elastic/apm/plugin/spi/DisabledObjectPool.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,23 @@ | ||
package co.elastic.apm.plugin.spi; | ||
|
||
public class DisabledObjectPool<T> implements ObjectPool<T> { | ||
|
||
private final Allocator<T> allocator; | ||
|
||
public DisabledObjectPool(Allocator<T> allocator) { | ||
this.allocator = allocator; | ||
} | ||
|
||
@Override | ||
public T createInstance() { | ||
return allocator.createInstance(); | ||
} | ||
|
||
@Override | ||
public void recycle(T obj) { | ||
} | ||
|
||
@Override | ||
public void clear() { | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
apm-agent-plugin-spi/src/main/java/co/elastic/apm/plugin/spi/DisabledObjectPoolFactory.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,14 @@ | ||
package co.elastic.apm.plugin.spi; | ||
|
||
public class DisabledObjectPoolFactory implements ObjectPoolFactory { | ||
|
||
public static final ObjectPoolFactory INSTANCE = new DisabledObjectPoolFactory(); | ||
|
||
private DisabledObjectPoolFactory() { | ||
} | ||
|
||
@Override | ||
public <T extends Recyclable> ObjectPool<T> createRecyclableObjectPool(int maxCapacity, Allocator<T> allocator) { | ||
return new DisabledObjectPool<T>(allocator); | ||
} | ||
} |
Oops, something went wrong.