Suffix ordering inconsistency
starksm64 Sep 10, 2005 9:37 PMIn looking into the .har/.jar ordering change introduced with the har deployer removal: http://jira.jboss.com/jira/browse/JBAS-2232 it seems we are not really handling the new ehanced suffix notion consistently. Some of the existing problems I'm seeing are:
- There is too much reliance on the code level defaults and this is resulting in inconsistencies if a deployer is updated to override these settings. For example, the SARDeployer externalized its suffixes to ".sar,.sar/,.har,.har/,.deployer,.deployer/,service.xml,deployer.xml", but did not set its RelativeOrdering so it defaults to 500. A number of the suffixes in the xmbean descriptor are simply ignored because there is a pre-existing default with a different relative order coming from the SuffixOrderHelper. The end result is that a number of these suffixes are sorted incorrectly, but it largely did not matter because they are unused. Where it did matter is for the har deployer which previously was registering a 400:.har extended suffix, but is now 500:{.har,.har/}. I don't think there should be any code level defaults in SuffixOrderHelper. All code level defaults should be coming from the deployers themselves.
- There is no enhancedSuffix notion at the SubDeployerMBean level. There is only a Suffixes + RelativeOrder configuration which is used to build the enhanced suffix order as the cross product of Suffixes[] x RelativeOrder. There needs to be an ability to specify finer grain suffix ordering for a deployer at the SubDeployer base class implementation, and this is what should be queried by the MainDeployer.addDeployer(SubDeployer) method. This can be built from the Suffixes[] x RelativeOrder if there is no EnhancedSuffixOrder[] specified.
- There is an inconsistency in the handling of non-directory vs directory suffixes (.har vs .har/). One issue is the directory suffixes do not have defaults so there are invalid seperation of .sar vs .sar/ for example. That should be cleaned up by moving the default to the deployers themselves. The other is mentioned by Dimitris in JBAS-2000: suffixes that end with '/' are practically ignored by the DeploymentSorter, but it doesn't really matter if the suffix appears in both forms (i.e. .sar and .sar/). The effectively undoes first error since the 500:.sar/ suffix is treated the same as 200:.sar. Nothing like the two wrongs make a right school of coding.
So, the three things I think we need to do to clean this up are:
1. Remove all of the SuffixOrderHelper EnhancedSuffixOrder defaults.
2. Add support for EnhancedSuffixOrder to the SubDeployer/SubDeployerSupport. This would be an incompatible change as any SubDeployer not extending SubDeployerSupport would fail to deploy with a NoSuchMethodError. A SubDeployerExt interface that extends SubDeployer could be added with MainDeployer.addDeployer(SubDeployer) performing a runtime type check for the SubDeployerExt interface to determine how the EnhancedSuffixOrder should be obtained.
3. Fix the defaults of every jboss deployer and utilize the EnhancedSuffixOrder where deployers have externalized their suffix configuration.