0 Replies Latest reply on Nov 19, 2012 8:30 AM by wortner

    How to use modules with ServiceLoader....



      we switched recently to JBoss 7(from 5:)


      We have some "strange" design. Our ear application is using Java ServiceLoader service to load some, let's say, plugins from "plugins" folder we created in profile directory. We can change these jars only during server restart.


      Now what I want to reach using jBoss 7.


      - I'd like to be able to redeploy "plugins" jar on the fly i.e. using Maven jboss-as-plugin.

      - Have possibility to drop the jars in the deployment folder to redeploying them.

      - Maybe utilize the JBoss modules framework to do this(but I'm affraid of these dependencies and modules.xmls etc. seams to complicated)


      So mainly is there a possibility to redeploy jars on the fly?

      Can I create one module, with all plugins inside, just to enable loading from main ear's ServiceLoader?(the ear will need only one dependency to this module with all plugins)

      What exactly are the "dynamic modules" how can I use them, static are copyied to "modules" folder, what about these dynamic ones?

      Isn't the easiest solution just to use extracted ear and copy/ overwrite the plugins in the /lib folder?

      What if the plugins formerly loaded only throught ServiceLoader have dependencies on the ear's libraries? Can ear have dependency on a module and the module dependency back to the ear???

      What exactly happens when module is loaded, is just the module classpath added to the dependent ear's classpath??? When I some how redeploy the module will it stop the parent ear file?


      Sorry for so many question, that are not so clear, because I have mixed so much things together, but just starting to understand this area.


      But any hints how can I "Hot deploy" plugins, probably using jboss module, are really appreciated.


      Best regards to all of you.