You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2021/12/20 11:47:06 UTC

[tomee] branch master updated: TOMEE-3821 Simplify, we don't even need that boolean looks like

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

jlmonteiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/master by this push:
     new f13442b  TOMEE-3821 Simplify, we don't even need that boolean looks like
f13442b is described below

commit f13442ba3259f7efda5701f0078a1a1d800ee1ec
Author: Jean-Louis Monteiro <jl...@tomitribe.com>
AuthorDate: Mon Dec 20 12:45:59 2021 +0100

    TOMEE-3821 Simplify, we don't even need that boolean looks like
---
 .../main/java/org/apache/openejb/cdi/WebappBeanManager.java  |  8 --------
 .../org/apache/openejb/cdi/WebappNotificationManager.java    | 12 ------------
 2 files changed, 20 deletions(-)

diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java b/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java
index 69ea4da..ebaddd5 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappBeanManager.java
@@ -23,10 +23,7 @@ import org.apache.webbeans.component.ExtensionBean;
 import org.apache.webbeans.component.OwbBean;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
-import org.apache.webbeans.container.InjectableBeanManager;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
-import org.apache.webbeans.event.EventMetadataImpl;
-import org.apache.webbeans.event.NotificationManager;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.WebBeansUtil;
 
@@ -42,7 +39,6 @@ import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.inject.spi.InjectionTarget;
 import javax.enterprise.inject.spi.InterceptionType;
 import javax.enterprise.inject.spi.Interceptor;
-import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.inject.spi.PassivationCapable;
 import java.lang.annotation.Annotation;
 import java.util.HashSet;
@@ -302,10 +298,6 @@ public class WebappBeanManager extends BeanManagerImpl {
         started = true;
         deploymentBeans = mergeBeans();
         webappCtx.getBeanManagerImpl().getInjectionResolver().clearCaches(); // to force new resolution with new beans
-        final NotificationManager notificationManager = webappCtx.getNotificationManager();
-        if (notificationManager instanceof WebappNotificationManager) { // should always be the case
-            ((WebappNotificationManager) notificationManager).afterStart();
-        } // otherwise, OWB itself knows when it's ready
     }
 
     private Set<Bean<?>> mergeBeans() {
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappNotificationManager.java b/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappNotificationManager.java
index 7ed4e31..33d0783 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappNotificationManager.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/WebappNotificationManager.java
@@ -30,13 +30,6 @@ import java.util.List;
 public final class WebappNotificationManager extends NotificationManager {
     private final NotificationManager parentNotificationManager;
 
-    /**
-     * We need to know when we did start.
-     * Lifecycle events will only get sent to the parent NotificationManager once the boot is finished.
-     * This is necessary to e.g. handle ProcessInjectionPoint for manual InjectionPointFactory calls.
-     */
-    private boolean hasStarted = false;
-
     public WebappNotificationManager(WebappWebBeansContext webappWebBeansContext) {
         super(webappWebBeansContext);
         this.parentNotificationManager = webappWebBeansContext.getParent() != null
@@ -44,11 +37,6 @@ public final class WebappNotificationManager extends NotificationManager {
                 : null;
     }
 
-
-    public void afterStart() {
-        hasStarted = true;
-    }
-
     /**
      * Collect the observer methods of the parent BeanManager plus the own.
      */