This is an automated email from the ASF dual-hosted git repository.
mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new 96f944c Add missed class from previous commit
96f944c is described below
commit 96f944c55f039fd349db4a5ad3bcaf9e69cf20e8
Author: Matt Sicker <[email protected]>
AuthorDate: Sun Mar 27 20:36:47 2022 -0500
Add missed class from previous commit
Signed-off-by: Matt Sicker <[email protected]>
---
.../java/org/apache/logging/log4j/core/config/Configuration.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
index e23be35..eaa2161 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
@@ -35,6 +35,7 @@ import org.apache.logging.log4j.plugins.di.Key;
import java.util.List;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Interface that must be implemented to create a configuration.
@@ -133,7 +134,11 @@ public interface Configuration extends Filterable {
<T> T getComponent(String name);
- <T> T getComponent(Key<T> key);
+ <T> Supplier<T> getFactory(Key<T> key);
+
+ default <T> T getComponent(Key<T> key) {
+ return getFactory(key).get();
+ }
void addComponent(String name, Object object);