Skip to main content

aspectj

Spring Roo ITD filter plugin for Eclipse Helios

Thanks to a bit of copy-paste from SpringSource Tool Suite and an answer on Stack Overflow, I was able to bash together a little plugin to filter Spring Roo ITD files from Eclipse's Package Explorer and Project Explorer. It's free to use for any purpose as far as I'm concerned, especially because I didn't write any of it. To use it, take the file attached to this story and drop it into eclipse/plugins.

(I probably could have taken the plugin from STS and dropped it into the standard Eclipse but it also has other features that I don't need.)

Weaving vs advising

It's not supposed to make a difference, but ...

// N.B. Due to an AspectJ implementation quirk where it does bytecode
// weaving instead of real VM advising, joinpoint shadows inside jar files
// will not be matched by pointcuts here.  That means we cannot use
// execution(void HttpServlet+.service(HttpServletRequest, HttpServletResponse)). :(
//
// If using other HTTP methods, you must add them here.
//
pointcut NDCFrame(HttpServletRequest request, HttpServletResponse response):
    args(request, response) && (
        execution(void HttpServlet+.doGet(HttpServletRequest, HttpServletResponse)) ||
        execution(void HttpServlet+.doPost(HttpServletRequest, HttpServletResponse))
    );

The solution is to use load-time weaving. Unfortunately, this requires modifying the container environment (rather than just the development environment) which increases the barrier to entry.

Syndicate content