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 2020/03/29 18:59:09 UTC

[logging-log4j2] 02/08: Specify targets for scopes

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

mattsicker pushed a commit to branch mean-bean-machine
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 0770786aea01ca6bd26fa905aa6ba6ac36f62e73
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sat Mar 28 13:00:16 2020 -0500

    Specify targets for scopes
    
    Signed-off-by: Matt Sicker <bo...@gmail.com>
---
 .../java/org/apache/logging/log4j/plugins/api/DependentScoped.java     | 3 +++
 .../java/org/apache/logging/log4j/plugins/api/SingletonScoped.java     | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/DependentScoped.java b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/DependentScoped.java
index da8e77e..b6f058c 100644
--- a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/DependentScoped.java
+++ b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/DependentScoped.java
@@ -18,9 +18,11 @@
 package org.apache.logging.log4j.plugins.api;
 
 import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
 /**
  * Dependent scoped beans are beans that belong to another bean. Beans with this scope are created and destroyed in
@@ -31,6 +33,7 @@ import java.lang.annotation.RetentionPolicy;
  * directly referenced by the application may be destroyed.
  */
 @Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
 @Documented
 @Inherited
 @ScopeType
diff --git a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/SingletonScoped.java b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/SingletonScoped.java
index 750bc69..5d8f967 100644
--- a/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/SingletonScoped.java
+++ b/log4j-plugins/src/main/java/org/apache/logging/log4j/plugins/api/SingletonScoped.java
@@ -18,12 +18,15 @@
 package org.apache.logging.log4j.plugins.api;
 
 import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
 // TODO: consider making this the default scope?
 @Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
 @Documented
 @Inherited
 @ScopeType