tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r702276 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Date Mon, 06 Oct 2008 21:34:27 GMT
Author: dblevins
Date: Mon Oct  6 14:34:27 2008
New Revision: 702276

URL: http://svn.apache.org/viewvc?rev=702276&view=rev
Log:
OPENEJB-919: MDBs should be sorted to end of the deployment list
Patch from Alex Grönholm.  Thanks, Alex!

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=702276&r1=702275&r2=702276&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Mon Oct  6 14:34:27 2008
@@ -683,6 +683,18 @@
     }
 
     private static List<DeploymentInfo> sort(List<DeploymentInfo> deployments)
{
+        // 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>(){
+            public String getName(DeploymentInfo t) {
+                return (String) t.getDeploymentID();
+            }
+
+            public Set<String> getReferences(DeploymentInfo t) {
+                return t.getDependsOn();
+            }
+        });
+
         // 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
@@ -706,18 +718,8 @@
                 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.
-        return References.sort(deployments, new References.Visitor<DeploymentInfo>(){
-            public String getName(DeploymentInfo t) {
-                return (String) t.getDeploymentID();
-            }
-
-            public Set<String> getReferences(DeploymentInfo t) {
-                return t.getDependsOn();
-            }
-        });
+        
+        return deployments;
     }
 
     public void destroy() {



Mime
View raw message