[jboss-cvs] JBossAS SVN: r63224 - projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 28 06:18:45 EDT 2007


Author: alesj
Date: 2007-05-28 06:18:45 -0400 (Mon, 28 May 2007)
New Revision: 63224

Modified:
   projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/IncompleteDeployments.java
Log:
Additional helper methods for incomplete deployment check.

Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/IncompleteDeployments.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/IncompleteDeployments.java	2007-05-28 10:07:45 UTC (rev 63223)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/IncompleteDeployments.java	2007-05-28 10:18:45 UTC (rev 63224)
@@ -103,6 +103,56 @@
    }
 
    /**
+    * Whether deployment unit is responsible for incomplete deployment.
+    *
+    * @param deploymentName deployment unit name
+    * @return true when deployment unit is responsible
+    */
+   public boolean isInvalidDeployment(String deploymentName)
+   {
+      if (isIncomplete() == false)
+         return false;
+
+      if (matchComponentName(deploymentName, getDeploymentsInError().keySet()))
+         return true;
+      if (matchComponentName(deploymentName, getDeploymentsMissingDeployer()))
+         return true;
+
+      return false;
+   }
+
+   /**
+    * Whether context is responsible for incomplete deployment.
+    *
+    * @param contextName context's name
+    * @return true when context is responsible
+    */
+   public boolean isInvalidContext(String contextName)
+   {
+      if (isIncomplete() == false)
+         return false;
+
+      if (matchComponentName(contextName, getContextsInError().keySet()))
+         return true;
+      if (matchComponentName(contextName, getContextsMissingDependencies().keySet()))
+         return true;
+
+      return false;
+   }
+
+   /**
+    * Search for componentName in strings.
+    *
+    * @param componentName component's name
+    * @param strings collection of strings
+    * @return true if strings contains component name
+    */
+   protected boolean matchComponentName(String componentName, Collection<String> strings)
+   {
+      return strings.contains(componentName);
+   }
+
+   /**
     * Get the contextsInError.
     * 
     * @return the contextsInError.




More information about the jboss-cvs-commits mailing list