4 Replies Latest reply on Jun 18, 2013 8:03 AM by Ramesh Reddy

    Deploying a custom archive in Jboss 7 to integrate into teiid

    Madhu Garimilla Newbie

      I have a custom archive(say custom.car) file  which contains the files of the format: *.xml, *.txt, jar files, war files, modules etc. I would like to deploy this archive in jboss 7 such that

      i can make use of exisitng jboss capabilities to deploy those file formats which are already supported by jboss(like deploying war files, modules etc ). This is something similar to how teiid

      is integrated into jboss as we are making use of Teiid and would like to provide support for all files(model.xml files, modules, translators, war, jar, txt files etc).

      This custom archive can be deployed normally or by using hot deployment.

       

      What are the steps need to be followed to implement such funcationality in jboss. Could someone point me to the right documentation. I have gone through the Jboss 7 documentation

      (Extending jboss, Subsystems) but i could not really figure out the exact flow to integarte the custom archives into jboss.

        • 1. Re: Deploying a custom archive in Jboss 7 to integrate into teiid
          Steven Hawkins Master

          This may be a fairly substancial undertaking.  You can have a look at Teiid's utilization of the deployer framework to get an idea of how this could be done:

           

          For AS 7.2/EAP 6.1: https://github.com/teiid/teiid/tree/master/jboss-integration/src/main/java/org/teiid/jboss

           

          If you have the notion of a subsystem, such as a runtime framework that is is configurable and not just a custom archive, you'll need classes similar to: TeiidAdd, TeiidSubsystemParser, and TeiidSubsytemResourceDefinition/TeiidOperationHandler (for cli operations)

           

          If you just want to handle the custom artifact, then see the simple handling for our custom translator jars in the Translator* classes.  Primarily TranslatorStructureDeployer to detect translator deployments, and TranslatorDeployer

           

          The VDB related classes have more complicated handling, such as setting up classpaths, but don't have anything related to embedded war files which you'd have to research futher.

           

          Perhaps what you really want is something more like an ear format, but want some additional handling for Teiid.

           

          Steve

          • 2. Re: Deploying a custom archive in Jboss 7 to integrate into teiid
            Madhu Garimilla Newbie

            Hi Steve, Thank you very much for the reply. This is the same thing that i am looking for. Almost all of my artifacts are teiid related and i shall be bundling them into a custom archive.

            Inside my subsystem, I would like to delegate some of the deployment tasks to teiid such as Translator/module deployment, vdb deployment and tasks such as war deployment to jboss.  Could you please help me with the following.

             

            1. I would like to understand how the dependencies are handled between the deployment units. For example, deploying a module depends on deploying another module. Do we have any similar use cases handled in teiid sub system?  

            2. How is jboss handling the deployment task as an atomic operation, I see the deploy method inside DeploymentUnitProcessor mentions that either it gets successfully completes this operation or throws an exception and rollbacks all changes. Is jboss going to take care of this roll back automatically or we need to provide any implemention for this.

             

            Thanks again for quick and detailed reply. It was really helpful

            • 3. Re: Deploying a custom archive in Jboss 7 to integrate into teiid
              Steven Hawkins Master

              > 1. I would like to understand how the dependencies are handled between the deployment units. For example, deploying a module depends on deploying another module. Do we have any similar use cases handled in teiid sub system?

               

              You'll want to differentiate between modules - which have their own dependency mechanism in the jar manifest or with the main.xml used in full module.  And services, which is what the AS is managing at runtime that can have dependencies to modules.  If you have a missing dependency to your module, attempting to use it should throw a ModuleLoadException.  VDBDependencyDeployer shows how we build a classpath for use in the vdb based upon the lib property and any jars contained in the lib of the zip archive.  This means that we are referencing already deployed modules and creating simple jar-based modules.

               

              > 2. How is jboss handling the deployment task as an atomic operation, I see the deploy method inside DeploymentUnitProcessor mentions that either it gets successfully completes this operation or throws an exception and rollbacks all changes. Is jboss going to take care of this roll back automatically or we need to provide any implemention for this.

               

              As long as all of your actions are through the deployer framework it seems like AS should handle it, but Ramesh or the AS team would be best to ask about the specifics.  If you are creating files and taking other actions in your deployment it seems like you'll be responsible for cleanup.

              • 4. Re: Deploying a custom archive in Jboss 7 to integrate into teiid
                Ramesh Reddy Master

                Cleanup usually means termination of related services that were activated in that deployment cycle. Just like how you add code "add" step, you need to add code for "remove" step.