I have a class which wraps a connection pool, the class gets its connection details from a spring configuration as shown below:
You can combine @Autowired
with @Qualifier
, but in this case instead of @Autowired
, I suggest using @Resource
:
@Resource(name="jedisConnector")
JedisConnector beanA;
@Resource(name="jedisConnectorPOD")
JedisConnector beanB;
or even simpler:
@Resource
JedisConnector jedisConnector;
@Resource
JedisConnector jedisConnectorPOD;
@Autowired
@Qualifier("jedisConnector")
JedisConnector beanA;
@Autowired
@Qualifier("jedisConnectorPOD")
JedisConnector beanB;