I could do it using spring profiles. I just added "master" profile to all listener beans and activated master profile only on master server.
Few nice articles to begin with using profiles
http://diarmuidmoloney.wordpress.com/2012/04/07/spring-environments/
http://maciejwalkowiak.pl/blog/2012/03/27/spring-3-1-profiles-and-tomcat-configuration/