James Server
  1. James Server
  2. JAMES-633

Contrib: James Auto Compiler Component (for Mailets, HandlerChains, etc, etc)

    Details

      Description

      As I promised here in JAMES-617 ... the gift...

      Is a component for James (fully integrated), an automatic compiler of classes, to compile automatically Mailets, SMTPHandlerChains, etc, etc (if mailet/handler/class needs to compile other classes, it will do it so that everything compiles correctly).

      I have proven it with these three, but surely he will be worth for more things.

      The best thing is than it does not require to change other classes like JamesMailetLoader/MatcherLoader, SMTPHandlerChain,... and if you do not like or you do not use it, you can deactivate just by to change the config.xml

      I believe that he is quite useful, since to add to a new Command in SMTPHandlerChain or new Mailet it is as easy as to place the Java sourcecode in a directory, change the config and Restart James, the rest... automatic.

      • It can work with the JDTCompiler 3.1.2 that comes bundled with Tomcat 5.5 (jasper-compiler-jdt.jar), but is necessary to change two lines of code in the JDTCompiler.java (line: 350 / 423)
      1. JamesCompilerClassLoader-src.jar
        10 kB
        Guillermo Grandes
      2. ecj.jar
        1.26 MB
        Guillermo Grandes

        Activity

        Hide
        Guillermo Grandes added a comment -

        Attach the source code & ecj.jar (Eclipse JDT Core Batch Compiler 3.2) in case you want to add it to the Trunk.

        Configuration (very easy) is documented in JamesCompilerClassLoader.java

        SAR-INF/assembly.xml (top of the file, before James or any other "block")

        + <block name="classcompiler" class="org.apache.james.util.JamesCompilerClassLoader" />

        <!-- The James block -->
        <block name="James" class="org.apache.james.James" >

        SAR-INF/config.xml (create this block)

        <classcompiler enabled="true">
        <sourceDir usePlainDir="true">file://dynamic/src</sourceDir>
        <classDir>file://dynamic/classes</classDir>
        </classcompiler>

        Show
        Guillermo Grandes added a comment - Attach the source code & ecj.jar (Eclipse JDT Core Batch Compiler 3.2) in case you want to add it to the Trunk. Configuration (very easy) is documented in JamesCompilerClassLoader.java SAR-INF/assembly.xml (top of the file, before James or any other "block") + <block name="classcompiler" class="org.apache.james.util.JamesCompilerClassLoader" /> <!-- The James block --> <block name="James" class="org.apache.james.James" > SAR-INF/config.xml (create this block) <classcompiler enabled="true"> <sourceDir usePlainDir="true"> file://dynamic/src </sourceDir> <classDir> file://dynamic/classes </classDir> </classcompiler>
        Hide
        Guillermo Grandes added a comment -

        Eclipse JDT Core Batch Compiler (3.2)

        Show
        Guillermo Grandes added a comment - Eclipse JDT Core Batch Compiler (3.2)

          People

          • Assignee:
            Unassigned
            Reporter:
            Guillermo Grandes
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development