[jboss-svn-commits] JBL Code SVN: r26375 - in labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta: tests/src/org/jboss/soa/esb/listeners/deployers/mc and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue May 5 07:20:24 EDT 2009


Author: beve
Date: 2009-05-05 07:20:23 -0400 (Tue, 05 May 2009)
New Revision: 26375

Modified:
   labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParserUnitTest.java
Log:
Added some more javadocs


Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java	2009-05-05 10:46:22 UTC (rev 26374)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParser.java	2009-05-05 11:20:23 UTC (rev 26375)
@@ -55,11 +55,28 @@
  * Sample configuration:
  * <pre>{@code
  *  <bean name="EsbConfigParser" class="org.jboss.soa.esb.listeners.deployers.mc.EsbConfigParser">
- *   <property name="deploymentPrefix">jboss.esb:deployment=</property>
+ *   <property name="esbDeploymentPrefix">jboss.esb:deployment=</property>
+ *   <property name="warDeploymentPrefix">jboss.web.deployment:war=</property>
  *   <property name="actionArtifactsFile">/actionArtifactMap.properties</property>
- *  </bean>
+ * </bean>
  * }</pre>
  * 
+ * <lu>
+ *  <li><i>esbDeploymentPrefix</i> This is the prefix that a ESB archive deployments will have in JBoss AS. Defaults to 'jboss.esb:deployment='.</li>
+ *  <li><i>warDeploymentPrefix</i> This is the prefix that a war archive deployments will have in JBoss AS. These  
+ *      are used for .war archives specified in the 'esb-depends' section of a deployment.xml file. Defaults to 'jboss.web.deployment:war='
+ *  </li>
+ *  <li><i>actionArtifactsFile</i> Properties file containing an action name to .esb archive mapping. Defaults to '/actionArtifactMap.properties'.  
+ *  <br>
+ *  For example, and entry in the file could look like this: <br>
+ *  org.jboss.soa.esb.smooks.SmooksAction=smooks.esb
+ *  <br>
+ *  This says that the SmooksAction exists in the smooks.esb archive. Adding these mappings means that commonly 
+ *  used actions don't need to be explicetely added to the deployment.xml of all deployments. These will be implicit
+ *  instead.
+ *  </li>
+ * </lu>
+ * 
  * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
  */
 public class EsbConfigParser extends AbstractVFSParsingDeployer<EsbMetaData>
@@ -75,6 +92,11 @@
     private static final String ESB_ARCHIVE_SUFFIX = ".esb";
     
     /**
+     * Name and path of the esb deployment.xml file.
+     */
+    private static final String ESB_DEPLOYMENT_XML = "META-INF/deployment.xml";
+    
+    /**
      * File filter for esb config files.
      */
     private static EsbConfigFileFilter configFileFilter = new EsbConfigFileFilter();
@@ -85,7 +107,7 @@
     private String actionArtifactsFile = "/actionArtifactMap.properties";
     
     /**
-     * The read action properties.
+     * The actions to .esb archive mappings file.
      */
     private Properties actionArtifactProperties;
     
@@ -95,7 +117,8 @@
     private String esbDeploymentPrefix = "jboss.esb:deployment=";
     
     /**
-     * Deployment prefix for war deployments.
+     * Deployment prefix for war deployments. The are for the war declared in the 'esb-depends' section
+     * of deployment.xml.
      */
     private String warDeploymentPrefix = "jboss.web.deployment:war=";
 
@@ -105,7 +128,13 @@
     private Logger log = Logger.getLogger(EsbConfigParser.class);
 
     /**
-     * No args constructor.
+     * Sole constructor that performas the following steps:
+     * <lu>
+     *  <li>Sets the output of this deployer to be {@link EsbMetaData}.</li>
+     *  <li>Sets the suffix to {@link EsbConfigParser#ESB_FILE_SUFFIX}.</li>
+     *  <li>Sets the jar extension to {@link EsbConfigParser#ESB_ARCHIVE_SUFFIX}.</li>
+     *  <li>Sets this deployers deployment stage to {@link DeploymentStages#PARSE}./li>
+     * </lu>
      */
     public EsbConfigParser()
     {
@@ -115,12 +144,21 @@
         setStage(DeploymentStages.PARSE);
     }
 
+    /**
+     * Create will load the action artifacts file configured.
+     * 
+     * @throws Exception If the action artifacts files cannot be loaded.
+     */
     public void create() throws Exception
     {
         log.info("Created");
         actionArtifactProperties = JBossDeployerUtil.getArtifactProperties(actionArtifactsFile);
     }
 
+    /**
+     * Will parse the VirtualFile representing the deployment and parse the esb configuration xml and extract information from 
+     * the archive to create an {@link EsbMetaData} instance that will be returned.
+     */
     @Override
     protected EsbMetaData parse(final VFSDeploymentUnit deploymentUnit, final VirtualFile file, final EsbMetaData metadata) throws Exception
     {
@@ -185,7 +223,7 @@
     private Set<ObjectName> getDependenciesFromDeploymentXml(final VFSDeploymentUnit deploymentUnit) throws DeploymentException
     {
         final Set<ObjectName> dependencies = new HashSet<ObjectName>();
-        final VirtualFile deploymentFile = deploymentUnit.getFile("META-INF/deployment.xml");
+        final VirtualFile deploymentFile = deploymentUnit.getFile(ESB_DEPLOYMENT_XML);
         try
         {
             if (deploymentFile != null && deploymentFile.exists())
@@ -193,7 +231,7 @@
                 try
                 {
                     XmlFileLoader xfl = new XmlFileLoader();
-                    Element jboss = xfl.getDocument(deploymentFile.openStream(), "META-INF/deployment.xml").getDocumentElement();
+                    Element jboss = xfl.getDocument(deploymentFile.openStream(), ESB_DEPLOYMENT_XML).getDocumentElement();
                     // Check for a ejb level class loading config
                     @SuppressWarnings("unchecked")
                     Iterator depends = MetaData.getChildrenByTagName(jboss, "depends");
@@ -288,23 +326,23 @@
         return deps;
     }
     
-    private String getDeploymentName(VFSDeploymentUnit deploymentUnit)
+    private String getDeploymentName(final VFSDeploymentUnit deploymentUnit)
     {
         final String simpleName = deploymentUnit.getSimpleName();
         return simpleName.substring(0, simpleName.indexOf(ESB_ARCHIVE_SUFFIX));
     }
 
-    public void setActionArtifactsFile(String actionArtifactsFile)
+    public void setActionArtifactsFile(final String actionArtifactsFile)
     {
         this.actionArtifactsFile = actionArtifactsFile;
     }
     
-    public void setEsbDeploymentPrefix(String deploymentPrefix)
+    public void setEsbDeploymentPrefix(final String deploymentPrefix)
     {
         this.esbDeploymentPrefix = deploymentPrefix;
     }
     
-    public void setWarDeploymentPrefix(String deploymentPrefix)
+    public void setWarDeploymentPrefix(final String deploymentPrefix)
     {
         this.warDeploymentPrefix = deploymentPrefix;
     }

Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParserUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParserUnitTest.java	2009-05-05 10:46:22 UTC (rev 26374)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/rosetta/tests/src/org/jboss/soa/esb/listeners/deployers/mc/EsbConfigParserUnitTest.java	2009-05-05 11:20:23 UTC (rev 26375)
@@ -50,6 +50,7 @@
         EsbMetaData esbMetaData = TestUtil.getEsbMetaData(parserDeployer, dir, "exploded-esb-archive.esb");
         assertEquals("exploded-esb-archive.esb", esbMetaData.getArchiveName());
         assertEquals("exploded-esb-archive", esbMetaData.getDeploymentName());
+        
         Set<ObjectName> deps = esbMetaData.getDependencies();
         assertEquals(3, deps.size());
         assertTrue(deps.contains(new ObjectName("jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_esb")));




More information about the jboss-svn-commits mailing list