Each service populated by this bean has the same name as the service it is bound to.
Usage:
Most applications should use either the Java config using
ServiceScan
annotation
or XML config using <cloud:service-scan/> that introduce a bean of this type logically
equivalent to:
<bean class="org.cloudfoundry.runtime.service.CloudServicesScanner"/>
to have an easy access to all the services.
If there is unique bean of a type, you can inject beans using the following
code (shows Redis, but the same scheme works for all services):
@Autowired RedisConnectionFactory redisConnectionFactory;
If there are more than one services of a type, you can use the @Qualifier
as in the following code:
@Autowired @Qualifier("service-name1") RedisConnectionFactory redisConnectionFactory;
@Autowired @Qualifier("service-name2") RedisConnectionFactory redisConnectionFactory;