Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6841

Contribution: PrioritizableDeploymentSorter

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Obsolete
    • Icon: Major Major
    • No Release
    • No Release
    • Deployers
    • None
    • Any - basic functionality.

      This is a contribution, not a feature request. Dennis in support indicated this is the correct mechanism. Please guide me in the right direction if it is not.

      Problem being solved:

      • We use the Unified ClassLoader to allow us to deploy reusable components only once. Thus, client applications do not have to have duplicate instances of JARs and resources.
      • In our case, most of the projects containing reusable components are SARs or EARs.
      • Those SARs and EARs are tiered, and therefore have dependencies on some of the other SARs and EARs.
      • Business reasons prevent us from renaming the applications to force-fit them into the ordering scheme supported by either the default DeploymentSorter or the alternate prefix-based deployment sorter currently available.
      • A quick Google search showed that many others have similar needs.

      Solution description:

      • Use a file (server/<serverType>/conf/appLoadPriority.properties) to give a priority number to each 'prioritized' application.
      • Priority 0 loads first, 1 second, and so on. Priority numbers do not need to be sequential (0, 10, 20 is fine).
      • Multiple applications may have the same priority. For example, all applications included in the jBoss distribution naturally have priority 0 and therefore load first.
      • Applications that are not explicitly listed load last.
      • Applications may be listed even if they have not yet been deployed to the server. Those entries are simply ignored.
      • Within a given priority, the order remains the same as that of the default org.jboss.deployer.DeploymentSorter (that is, by extension, with the order specified there).

      The implementation is in one class (org.jboss.deployment.PrioritizableDeploymentSorter), one config file (mentioned above) and a one line change in server/<serverType>/conf/jBoss-service.xml to tell it to use that Comparator.

      Note: This was only a half-day job. It is a reliable no frills implementation, but could easily be fancier, use XML files, or not require listing jBoss' apps. Feel free to modify as needed. It won't hurt my feelings.

      The code and a sample appLoadPriority.properties file will be attached if Jira allows it in later screens. If not, please provide a URL or email address to submit the code and sample file.

        1. appLoadPriority.properties
          1 kB
          Dennis Reed

              dandread1@redhat.com Dimitrios Andreadis
              bmelloni_jira Bruno Melloni (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: