[jboss-cvs] JBossAS SVN: r69558 - in projects/microcontainer/trunk: deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Feb 2 20:42:32 EST 2008


Author: alesj
Date: 2008-02-02 20:42:32 -0500 (Sat, 02 Feb 2008)
New Revision: 69558

Modified:
   projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java
   projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/DefaultDeploymentContextComparator.java
   projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/RelativeDeploymentContextComparator.java
Log:
Make comparator optional.

Modified: projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java	2008-02-03 00:34:44 UTC (rev 69557)
+++ projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java	2008-02-03 01:42:32 UTC (rev 69558)
@@ -42,7 +42,6 @@
 import org.jboss.deployers.structure.spi.DeploymentContext;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployers.structure.spi.StructuralDeployers;
-import org.jboss.deployers.structure.spi.helpers.RelativeDeploymentContextComparator;
 import org.jboss.deployers.structure.spi.helpers.RevertedDeploymentContextComparator;
 import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
 import org.jboss.logging.Logger;
@@ -101,11 +100,6 @@
    private Comparator<DeploymentContext> comparator;
    private Comparator<DeploymentContext> reverted;
 
-   public MainDeployerImpl()
-   {
-      setComparator(RelativeDeploymentContextComparator.INSTANCE);
-   }
-
    /**
     * Set the top deployment context comparator.
     *
@@ -512,13 +506,15 @@
             undeployContexts = new ArrayList<DeploymentContext>(undeploy.size());
             for (int i = undeploy.size() - 1; i >= 0; --i)
                undeployContexts.add(undeploy.get(i));
-            Collections.sort(undeployContexts, reverted);
+            if (reverted != null)
+               Collections.sort(undeployContexts, reverted);
             undeploy.clear();
          }
          if (deploy.isEmpty() == false)
          {
             deployContexts = new ArrayList<DeploymentContext>(deploy);
-            Collections.sort(deployContexts, comparator);
+            if (comparator != null)
+               Collections.sort(deployContexts, comparator);
             deploy.clear();
          }
 

Modified: projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/DefaultDeploymentContextComparator.java
===================================================================
--- projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/DefaultDeploymentContextComparator.java	2008-02-03 00:34:44 UTC (rev 69557)
+++ projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/DefaultDeploymentContextComparator.java	2008-02-03 01:42:32 UTC (rev 69558)
@@ -21,8 +21,8 @@
 */
 package org.jboss.deployers.structure.spi.helpers;
 
+import java.io.Serializable;
 import java.util.Comparator;
-import java.io.Serializable;
 
 import org.jboss.deployers.structure.spi.DeploymentContext;
 
@@ -48,6 +48,11 @@
          return o1.getSimpleName().compareTo(o2.getRelativePath());
    }
 
+   public static Comparator<DeploymentContext> getInstance()
+   {
+      return INSTANCE;
+   }
+
    Object readResolve()
    {
       return INSTANCE;

Modified: projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/RelativeDeploymentContextComparator.java
===================================================================
--- projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/RelativeDeploymentContextComparator.java	2008-02-03 00:34:44 UTC (rev 69557)
+++ projects/microcontainer/trunk/deployers-structure-spi/src/main/org/jboss/deployers/structure/spi/helpers/RelativeDeploymentContextComparator.java	2008-02-03 01:42:32 UTC (rev 69558)
@@ -43,6 +43,11 @@
       return o1.getRelativeOrder() - o2.getRelativeOrder();
    }
 
+   public static Comparator<DeploymentContext> getInstance()
+   {
+      return INSTANCE;
+   }
+
    Object readResolve()
    {
       return INSTANCE;




More information about the jboss-cvs-commits mailing list