[jboss-cvs] JBossAS SVN: r68597 - trunk/spring-int/src/main/org/jboss/spring/deployers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 3 07:43:50 EST 2008


Author: alesj
Date: 2008-01-03 07:43:50 -0500 (Thu, 03 Jan 2008)
New Revision: 68597

Modified:
   trunk/spring-int/src/main/org/jboss/spring/deployers/SpringParserDeployer.java
Log:
Legacy default name option.

Modified: trunk/spring-int/src/main/org/jboss/spring/deployers/SpringParserDeployer.java
===================================================================
--- trunk/spring-int/src/main/org/jboss/spring/deployers/SpringParserDeployer.java	2008-01-03 12:35:52 UTC (rev 68596)
+++ trunk/spring-int/src/main/org/jboss/spring/deployers/SpringParserDeployer.java	2008-01-03 12:43:50 UTC (rev 68597)
@@ -34,37 +34,39 @@
  */
 public class SpringParserDeployer extends AbstractVFSParsingDeployer<SpringMetaData> implements FileMatcher
 {
-   private boolean useMetaFileNameAsDefault;
+   private boolean useLegacyDefaultName;
 
    public SpringParserDeployer()
    {
       super(SpringMetaData.class);
       setSuffix("-spring.xml");
-      setUseMetaFileNameAsDefault(true);
+      setUseLegacyDefaultName(false);
    }
 
    /**
     * Get the use name flag.
     *
-    * @return true if the default name should be determined from meta file
+    * @return true if the default name should be determined from deployment unit
     */
-   protected boolean isUseMetaFileNameAsDefault()
+   protected boolean isUseLegacyDefaultName()
    {
-      return useMetaFileNameAsDefault;
+      return useLegacyDefaultName;
    }
 
    /**
-    * Should we use meta file name as default.
-    * e.g. using string before -spring.xml as the name
+    * Should we use deployment unit's name as default.
+    * e.g. using string before .jar|spring|... as the name
     *
     * Previous versions used string before .spring as the name,
-    * setting this to false results in this legacy behaviour.
+    * setting this to true results in this legacy behaviour.
     *
-    * @param useMetaFileNameAsDefault the flag
+    * Current default is string before -spring.xml.
+    *
+    * @param useLegacyDefaultName the flag
     */
-   public void setUseMetaFileNameAsDefault(boolean useMetaFileNameAsDefault)
+   public void setUseLegacyDefaultName(boolean useLegacyDefaultName)
    {
-      this.useMetaFileNameAsDefault = useMetaFileNameAsDefault;
+      this.useLegacyDefaultName = useLegacyDefaultName;
    }
 
    /**
@@ -96,10 +98,11 @@
    protected SpringMetaData parse(VFSDeploymentUnit unit, VirtualFile file, SpringMetaData metaData) throws Exception
    {
       String defaultName;
-      if (isUseMetaFileNameAsDefault())
+      if (isUseLegacyDefaultName())
+         defaultName = getDefaultName(unit);
+      else
          defaultName = getDefaultName(file);
-      else
-         defaultName = getDefaultName(unit);
+
       return new SpringMetaData(file.toURL(), defaultName);
    }
 




More information about the jboss-cvs-commits mailing list