Skip to content

Instantly share code, notes, and snippets.

@twasink
Created November 9, 2011 01:10
Show Gist options
  • Save twasink/1349979 to your computer and use it in GitHub Desktop.
Save twasink/1349979 to your computer and use it in GitHub Desktop.
Creating a qualified bean using Grails Spring DSL
In order to match a @Qualifier reference like this (in a Spring-managed bean):
public class MyManagedBean {
@Autowired @Qualifier("bean_a") private MyBean myBean;
}
using the Grails Spring DSL, you do this:
myBean(MyBean) { bean ->
bean.beanDefinition.addQualifier(new org.springframework.beans.factory.support.AutowireCandidateQualifier( org.springframework.beans.factory.annotation.Qualifier, 'bean_a'))
}
There should be a better way of doing that.
@twasink
Copy link
Author

twasink commented Nov 9, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment