4 Replies Latest reply on Oct 10, 2006 1:17 PM by starksm64

    DeploymentContext needs attachments

    bill.burke

      In the EAR deployer, I'm finding that a DeploymentContext needs attachment. Why?

      * So that I don't have to parse application.xml twice
      * So that I can associate EAR module metadata to the DeploymentContext.


      Has there been any thought around how the EAR deployer (structure or whatever) passes metadata to subdeployments? i.e. context-root? I can figure something out, but it would be cool to have input.

      Thanks

        • 1. Re: DeploymentContext needs attachments
          bill.burke

           

          Has there been any thought around how the EAR deployer (structure or whatever) passes metadata to subdeployments? i.e. context-root? I can figure something out, but it would be cool to have input.


          I guess the way it would work would be add a WarEarIntegrationDeployer?

          1. WarParsingDeployer runs first
          2. WarEarIntegrationDeployer looks at deployment structure and modifies context-root metadata deployed by WarParsingDeployer. (same with other metadata).

          Sound right?


          • 2. Re: DeploymentContext needs attachments

            Can't you add that to the deployment context of the war?

            i.e.

            if (moduleTypeIsWar)
            {
             DeploymentContext warDeploymentContext = ...
             if (contextRoot != null)
             {
             ContextRootMetaData crmd = ...
             warDeploymentContext.getTransientManagementObjects().addAttachment(crmd);
             }
             earDeploymentContext.addChild(warDeploymentContext);
            }
            


            Then it is just a case of getting the war deployer to check it.
            It must already check it now from the DeploymentInfo in JBoss4?

            • 3. Re: DeploymentContext needs attachments
              bill.burke

              whoops, sorry...

              • 4. Re: DeploymentContext needs attachments
                starksm64

                 

                "adrian@jboss.org" wrote:
                Can't you add that to the deployment context of the war?

                i.e.
                if (moduleTypeIsWar)
                {
                 DeploymentContext warDeploymentContext = ...
                 if (contextRoot != null)
                 {
                 ContextRootMetaData crmd = ...
                 warDeploymentContext.getTransientManagementObjects().addAttachment(crmd);
                 }
                 earDeploymentContext.addChild(warDeploymentContext);
                }
                


                Then it is just a case of getting the war deployer to check it.
                It must already check it now from the DeploymentInfo in JBoss4?


                Currently the war deployer looks to the DeploymentInfo.webContext for an ear level override.

                while the web context-root could be pushed to the associated war context, other info like security roles apply to every component, and potentially needs to be merged. Same situation exists for standardjboss.xml/jboss.xml. To me this is getting more to needing the metadata repository to be able to access scope based overrides.