Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1929

[PATCH] Reloading classloader in Cocoon 2.2

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2
    • None
    • * Cocoon Core
    • None
    • Patch available

    Description

      The attached patch provides a first implementation to enable reloading classloader configuration into the sitemap, using the sitemap syntax used in blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/sitemap.xmap.

      Referring to CocoonGT 2005 Torsten's code, I moved all the JCI listener configuration into the ReloadingClassLoaderFactory class, that is in charge to parse the classloader configuration (filled by AvalonUtils class) and instanciate all the JCI listeners.

      The TreeProcessor component is subscribed to the JCI listeners, in order to reload the component definitions when a file change event is triggered.

      The patch provides also a sample : http://localhost:8888/blocks/cocoon-core-main-sample/reloading/
      Try to change MyGenerator.java and compile it into blocks/cocoon-core-sample/cocoon-core-main-sample/target/classes (default eclipse location); if you need to change the location of the .class folder, edit the cocoon-core-main-sample sitemap.xmap.
      core.

      Obviously there are many parts of the code that can be optimized.

      The patch has been applied on revision 453682.

      NOTE!
      1. I decided to provide the reloading class functionality only for dev mode, so, in order to get it working, you need to run the cocoon application with -Dorg.apache.cocoon.mode=dev
      2. The patch depends on a bugfix on Commons JCI (https://issues.apache.org/jira/browse/SANDBOX-174), so it's necessary to build jci-core from trunk; the patch will update the cocoon-bootstrap dependency to jci.

      Attachments

        1. addxconf.diff
          1 kB
          Maurizio Pillitu
        2. cocoon.diff
          33 kB
          Maurizio Pillitu
        3. cocoon-core-r469213.diff
          34 kB
          Maurizio Pillitu
        4. cocoon-r469167.diff
          25 kB
          Maurizio Pillitu

        Activity

          People

            Unassigned Unassigned
            mauriziop Maurizio Pillitu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: