3 Replies Latest reply on Jul 5, 2012 6:27 AM by ctomc

    Jboss AS 7 - SubSystem use as service for Application

    jayvijayraj

      Hi

       

      I would like to build a custom subsystem name "XYZService" which starts as normal subsystem at startup. Later i would like to deploy the module or war/ear file to use these XYZService to do stuff.

       

      I have tried makeing a custom subsystem, i have added it to the extenstions. But the XYZService APIs are not visible to another module or the deployed war/ear file.

       

      Could you please help me to find out how to make the XYZService API to the deployed application, i have tried adding the XYZService module as global module, but the instances were coming out as null.

       

      May be this is a weired POC but idea is to start the SubSystem as Service and share them among the modules / deployed applications when required.

       

      Thanks a lot, please help me find a proper way to achieve this.

       

      Regards,

      Jay

        • 1. Re: Jboss AS 7 - SubSystem use as service for Application
          ctomc

          Hi,

           

          that is quite easily to achive

           

          you need to create and register DeploymentUnitProcessor and inside your "deploy" method you can add additional module dependancies to your deployments.

           

          for example take a look at how SarModuleDependencyProcessor is done. there are many others but this one is one of simpler ones

           

           

          --

          tomaz

          • 2. Re: Jboss AS 7 - SubSystem use as service for Application
            jayvijayraj

            Thanks a lot for your answer.

             

            The subsystem is started fine. But how to access the instances of the subsystem into the deployed .war file is not clear to me.

             

            in other words, For me its still not clear how access the subsystem API inside the application (.war /.ear) file. Do i need to add any dependency wo my manifest file to access this subsystem API.

             

            Regards,

            Jay

            • 3. Re: Jboss AS 7 - SubSystem use as service for Application
              ctomc

              Hi,

               

              sure you can add subsystem dependancy to your deploying application, this way you will be able to access subsystem API from your application without manualy specifiying dependancies.

               

              or you can do it manualy, whatever suits you better

               

               

               

              --

              tomaz