You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2022/03/28 01:36:56 UTC

[logging-log4j2] branch master updated: Add missed class from previous commit

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 <ma...@apache.org>
AuthorDate: Sun Mar 27 20:36:47 2022 -0500

    Add missed class from previous commit
    
    Signed-off-by: Matt Sicker <ma...@apache.org>
---
 .../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);