Version 7



    The URLComparator is a configurable element of the DeploymentScanner that controls the order that packages are passed to the MainDeployer. There are two deployment comparators are shipped with JBoss.



    • org.jboss.deployment.DeploymentSorter

       The DeploymentSorter sorts the packages based on the the file extension of the package.  The sort order is

      • deployer (since 4.0)

      • -deployer.xml (since 4.0)

      • sar

      • -service.xml

      • rar

      • -ds.xml

      • har

      • jar

      • war

      • wsr

      • ear

      • zip

      • bsh

      • last



    • org.jboss.deployment.scanner.PrefixDeploymentSorter


    The PrefixDeploymentSorter examines the first characters of the file name to find packages that begin with numbers.   Files that do not start with numbers are deployed first according to the roles of the generic DeploymentSorter.  The remaining packages which do begin with numbers are then deployed in numeric order.   For example, the  package 20foo.war will be deployed before 100bar.sar even though the SAR file would normally deploy before the WAR file.


    • org.jboss.deployment.scanner.AlphaNumericDeploymentSorter


    The AlphaNumericDeploymentSorter extends the PrefixDeploymentSorter and resolves the occasional problem of deployments working on windows and not unix (or vise versa).  This problem originally stems from the way File.list() returns the list of files in a different order depending on platform.  So when doing the compare() for the Collections.sort() in the URLDeploymentScanner, if both the prefix and the file type are the same, leave it in the same order (which will have already been sorted by the File.list() call).  Hence the problem between platforms.  The AlphaNumericDeploymentSorter adds a final comparison of the file names using the String class' compareToIgnoreCase() method.  This is a new addition to JBoss 4.0.