Created
November 9, 2011 01:10
-
-
Save twasink/1349979 to your computer and use it in GitHub Desktop.
Creating a qualified bean using Grails Spring DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Grails JIRA issue: http://jira.grails.org/browse/GRAILS-8279