Misfiring Neurons Just another geek with a blog

8Apr/090

Annotation-based dispatch for Spring ApplicationEvents

I created a little extension that allows you to dispatch Spring application context events in a clean and type-safe way to POJO beans. Instead of implementing the ApplicationListener interface, one can simply create a handler as follows:

public class EventListener {
    @EventHandler
    public void onAppEvent(MyCustomEvent event) {
        // ...
    }
}

The code is available as a zipped up Maven project or via Git:

git clone http://pavel.tcholakov.net/code/eventhandler-annotation.git/

Related Spring forum thread.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.