[jboss-cvs] JBossAS SVN: r58284 - trunk/server/src/main/org/jboss/deployment

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Nov 12 17:36:01 EST 2006


Author: scott.stark at jboss.org
Date: 2006-11-12 17:35:57 -0500 (Sun, 12 Nov 2006)
New Revision: 58284

Modified:
   trunk/server/src/main/org/jboss/deployment/J2eeApplicationMetaData.java
Log:
Add a module accessor by pathname

Modified: trunk/server/src/main/org/jboss/deployment/J2eeApplicationMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/J2eeApplicationMetaData.java	2006-11-12 22:02:39 UTC (rev 58283)
+++ trunk/server/src/main/org/jboss/deployment/J2eeApplicationMetaData.java	2006-11-12 22:35:57 UTC (rev 58284)
@@ -43,7 +43,6 @@
  * @author Thomas.Diesler at jboss.org
  * @author Scott.Stark at jboss.org
  * @version $Revision$
- * @see org.jboss.metadata.XmlLoadable
  */
 public class J2eeApplicationMetaData
         extends MetaData
@@ -51,13 +50,17 @@
    // Constants -----------------------------------------------------
 
    // Attributes ----------------------------------------------------
+   /** application/display-name */
    private String displayName;
+   /** application/description */
    private String description;
+   /** application/icon */
    private IconMetaData icon = new IconMetaData();
-   /** The library-directory name, defaults to lib */
+   /** The application/library-directory name, defaults to lib */
    private String libDirName = "lib";
    /** The application element version */
-   private String version;  
+   private String version;
+   /** jboss-app/loader-repository */
    private LoaderRepositoryFactory.LoaderRepositoryConfig loaderCfg;
 
    /**
@@ -65,7 +68,7 @@
     */
    private HashMap<String, SecurityRoleMetaData> securityRoles = new HashMap<String, SecurityRoleMetaData>();
    /**
-    * The jboss-app.xml JNDI name of the security domain implementation
+    * The jboss-app.xml/security-domain name
     */
    private String securityDomain;
    /**
@@ -119,8 +122,28 @@
       return icon.getLargeIcon();
    }
 
-   public Iterator getModules()
+   /**
+    * Get the module metadata for an application module 
+    * @param path - the J2eeModuleMetaData.fileName specified in application.xml 
+    * @return the module if it exists
+    */
+   public J2eeModuleMetaData getModule(String path)
    {
+      J2eeModuleMetaData module = modules.get(path);
+      if( path.startsWith("/") )
+      {
+         // try a non-absolute path
+         path = path.substring(1);
+         module = modules.get(path);
+      }
+      return module;
+   }
+   /**
+    * Get all modules defined in the application
+    * @return the modules iterator
+    */
+   public Iterator<J2eeModuleMetaData> getModules()
+   {
       return modules.values().iterator();
    }
 




More information about the jboss-cvs-commits mailing list