tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r979129 - /openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Date Mon, 26 Jul 2010 00:27:58 GMT
Author: dblevins
Date: Mon Jul 26 00:27:58 2010
New Revision: 979129

URL: http://svn.apache.org/viewvc?rev=979129&view=rev
Log:
OPENEJB-1296: Allow @DependsOn usage by all session bean types

Modified:
    openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java

Modified: openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=979129&r1=979128&r2=979129&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
(original)
+++ openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Mon Jul 26 00:27:58 2010
@@ -707,6 +707,17 @@ public class Assembler extends Assembler
     }
 
     private static List<DeploymentInfo> sort(List<DeploymentInfo> deployments)
{
+        // Sort all the singletons to the back of the list.  We want to make sure
+        // all non-singletons are created first so that if a singleton refers to them
+        // they are available.
+        Collections.sort(deployments, new Comparator<DeploymentInfo>(){
+            public int compare(DeploymentInfo a, DeploymentInfo b) {
+                int aa = (a.getComponentType() == BeanType.SINGLETON) ? 1 : 0;
+                int bb = (b.getComponentType() == BeanType.SINGLETON) ? 1 : 0;
+                return aa - bb;
+            }
+        });
+
         // Sort all the beans with references to the back of the list.  Beans
         // without references to ther beans will be deployed first.
         deployments = References.sort(deployments, new References.Visitor<DeploymentInfo>(){
@@ -719,19 +730,6 @@ public class Assembler extends Assembler
             }
         });
 
-        // Sort all the singletons to the back of the list.  We want to make sure
-        // all non-singletons are created first so that if a singleton refers to them
-        // they are available.  We have to do this as @DependsOn only points to other
-        // Singleton beans.  If it listed non-Singlton beans, then we wouldn't need to
-        // pre-sort.
-        Collections.sort(deployments, new Comparator<DeploymentInfo>(){
-            public int compare(DeploymentInfo a, DeploymentInfo b) {
-                int aa = (a.getComponentType() == BeanType.SINGLETON) ? 1 : 0;
-                int bb = (b.getComponentType() == BeanType.SINGLETON) ? 1 : 0;
-                return aa - bb;
-            }
-        });
-
         // Now Sort all the MDBs to the back of the list.  The Resource Adapter
         // may attempt to use the MDB on endpointActivation and the MDB may have
         // references to other ejbs that would need to be available first.



Mime
View raw message