openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r959614 - /openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
Date Thu, 01 Jul 2010 11:23:51 GMT
Author: gerdogdu
Date: Thu Jul  1 11:23:51 2010
New Revision: 959614

URL: http://svn.apache.org/viewvc?rev=959614&view=rev
Log:
Improvement

Modified:
    openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java

Modified: openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java?rev=959614&r1=959613&r2=959614&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
(original)
+++ openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
Thu Jul  1 11:23:51 2010
@@ -19,11 +19,11 @@
 package org.apache.webbeans.ejb;
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
 
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.Bean;
@@ -71,9 +71,9 @@ public class EjbPlugin extends AbstractO
     private Assembler assembler;
     
     private WebBeansLogger logger = WebBeansLogger.getLogger(EjbPlugin.class);
-
+    
     // List of deployed applications
-    private final Set<AppInfo> deployedApplications = new HashSet<AppInfo>();
+    private final Set<AppInfo> deployedApplications = new CopyOnWriteArraySet<AppInfo>();
     
     // TODO it should be Map<Class<?>,DeploymentInfo[]>
     private Map<Class<?>,DeploymentInfo> statelessBeans = new ConcurrentHashMap<Class<?>,
DeploymentInfo>();
@@ -100,6 +100,11 @@ public class EjbPlugin extends AbstractO
         try
         {
             super.shutDown();
+            this.deployedApplications.clear();
+            this.statelessBeans.clear();
+            this.statefulBeans.clear();
+            this.singletonBeans.clear();
+            this.containerSystem = null;            
         }
         catch (Exception e)
         {
@@ -189,6 +194,27 @@ public class EjbPlugin extends AbstractO
      */
     public void beforeApplicationDestroyed(AppInfo appInfo)
     {
+        this.deployedApplications.remove(appInfo);
+        for (EjbJarInfo ejbJar : appInfo.ejbJars)
+        {
+            for (EnterpriseBeanInfo bean : ejbJar.enterpriseBeans)
+            {
+                switch (bean.type)
+                {
+                    case EnterpriseBeanInfo.STATELESS:
+                        this.statelessBeans.remove(containerSystem.getDeploymentInfo(bean.ejbDeploymentId).getBeanClass());
+                        break;
+                    case EnterpriseBeanInfo.STATEFUL:
+                        this.statefulBeans.remove(containerSystem.getDeploymentInfo(bean.ejbDeploymentId).getBeanClass());
+                        break;
+                    case EnterpriseBeanInfo.SINGLETON:
+                        this.singletonBeans.remove(containerSystem.getDeploymentInfo(bean.ejbDeploymentId).getBeanClass());
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }        
     }
     
     public <T> Bean<T> defineSessionBean(Class<T> clazz, ProcessAnnotatedType<T>
processAnnotatedTypeEvent)



Mime
View raw message