7 Replies Latest reply on Nov 2, 2009 10:12 AM by alesj

    how to extend an already deployed application

    csabaszucs

      Hello JBoss Users,

      we are developing a JBoss-based reporting application with a web ui to trigger report generation jobs. We have currently 10 different types of reports that can be generated by this application.
      There is a requirement to let the end-user extend the application with new report types. So end users should be able to integrate new report types into the application in a hot deployment style, so without the demand of stopping/undeploying the application during the extension's time.

      Is there any standard way/design pattern/solution to do this within JBoss?

      (my very first unexperienced idea would be using JBoss OSGi: there would be an extension point for a new report type, and there would be one extension for every new report type or developing some specialised JBoss file scanner/deployment scanner is a feasible solution for that?).

      Many thanks in advance!
      Csaba

        • 1. Re: how to extend an already deployed application
          alesj

           

          "CsabaSzucs" wrote:

          Is there any standard way/design pattern/solution to do this within JBoss?

          With JBoss flat CL model this is very easy to achieve.

          e.g. see how we track Deployers against DeployersImpl
          --> JBOSS_HOME\server\default\conf\bootstrap\deployers.xml

           <!-- Accept any implementor of deployer -->
           <incallback method="addDeployer"/>
           <uncallback method="removeDeployer"/>
          


          Simply create and register some ReportRepository service against MC
          and then track any newly deployed Reports via MC's incallback mechanism.
          - http://java.dzone.com/articles/a-look-inside-jboss-microconta-0


          • 2. Re: how to extend an already deployed application
            csabaszucs

            Hello again,

            Thanks a lot for your fast help!

            I started to read the JBoss Microcontainer User Guide: a really interesting runtime/component/deployment environment!

            One question: may we use all the stuff you adviced me in JBoss 4.x or only in JBoss 5.y? Currently we are using JBoss 4.x.

            Thanks!
            Csaba

            • 3. Re: how to extend an already deployed application
              alesj

              Only JBoss5.

              You can also have a look at my MC demos project for more examples:
              - http://anonsvn.jboss.org/repos/jbossas/projects/demos/microcontainer/trunk/

              The whole project is fully Maven-ized,
              so it's very simple to use it, play around, debug, ...

              Once you grasp the concepts, you can easily apply them in JBoss5.

              • 4. Re: how to extend an already deployed application
                csabaszucs

                Hello Ales,

                so then I ask it in another way: is there any facility to hook on deployment callbacks /be notified about new deployments of applications, beans etc./ on JBoss 4.x?

                I think implementing a ReportRepository service is not a problem in JBoss4.x.

                I am not sure that we are allowed to shift to JBoss5.y nowadays...
                Thanks again!

                Csaba

                • 5. Re: how to extend an already deployed application
                  alesj

                   

                  "CsabaSzucs" wrote:

                  so then I ask it in another way: is there any facility to hook on deployment callbacks /be notified about new deployments of applications, beans etc./ on JBoss 4.x?

                  You can create your own deployer.

                  A deployer that would handle just particular type of deployments, matching on suffix.
                  e.g. my-new-report.rep or some-report.xml
                  Taking those services/beans from the deployment,
                  and handle them somehow - registering against ReportRegistry or whatever.

                  Try looking at the code for JBoss4.x, my spring-int module,
                  where I handle Spring specific deployments: .spring or -spring.xml.


                  • 6. Re: how to extend an already deployed application
                    csabaszucs

                    Ales,

                    How shall I extend JBoss deployment logics?
                    Based upon JBoss deployment SPI side or directly based upon the classes of SubDeployerSupport and the others like in the implementation of XSLSubDeployer?

                    So shall I implement my custom deployer class with the extension of org.jboss.deployment classes or with the extension of org.jboss.deployers.spi.deployer classes?

                    Thanks!
                    Csaba

                    • 7. Re: how to extend an already deployed application
                      alesj

                      It's been a while since I did 4.x deployers.
                      Like I said, try doing similar thing as I did for SpringDeployer.

                      If it was MC/AS5 I could help you a lot more. ;-)