List of usage examples for org.springframework.context.support GenericApplicationContext getAliases
@Override
public String[] getAliases(String name)
From source file:com.opengamma.component.factory.AbstractSpringComponentFactory.java
/** * Registers a set of beans by type./* w w w.j a v a 2s.c o m*/ * * @param <T> the type * @param repo the repository to register in, not null * @param type the type of bean to extract from the Spring context, not null * @param appContext the Spring context, not null */ protected <T> void registerInfrastructureByType(ComponentRepository repo, Class<T> type, GenericApplicationContext appContext) { String[] beanNames = appContext.getBeanNamesForType(type); for (String beanName : beanNames) { T bean = appContext.getBean(beanName, type); String name = simplifyName(type, beanName); repo.registerComponent(type, name, bean); String[] aliases = appContext.getAliases(beanName); for (String alias : aliases) { name = simplifyName(type, alias); repo.registerComponent(type, name, bean); } } }