You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2023/11/24 09:02:29 UTC

(logging-log4j2) 03/03: Add `@ServiceConsumer` to `log4j-plugin`

This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit e2faaa151ea2c9c5cf67344ae58aaf9849a29539
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Fri Nov 24 10:00:56 2023 +0100

    Add `@ServiceConsumer` to `log4j-plugin`
    
    This fixes the OSGi and JPMS descriptor.
---
 .../java/org/apache/logging/log4j/plugins/model/PluginRegistry.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/model/PluginRegistry.java b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/model/PluginRegistry.java
index d762431970..6aaa160dee 100644
--- a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/model/PluginRegistry.java
+++ b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/model/PluginRegistry.java
@@ -18,6 +18,8 @@ package org.apache.logging.log4j.plugins.model;
 
 import static org.apache.logging.log4j.util.Unbox.box;
 
+import aQute.bnd.annotation.Cardinality;
+import aQute.bnd.annotation.spi.ServiceConsumer;
 import java.io.IOException;
 import java.net.URL;
 import java.text.DecimalFormat;
@@ -38,6 +40,7 @@ import org.apache.logging.log4j.util.LoaderUtil;
  * Registry singleton for PluginType maps partitioned by source type and then by category names.
  */
 @Singleton
+@ServiceConsumer(value = PluginService.class, cardinality = Cardinality.MULTIPLE)
 public class PluginRegistry {
 
     /**