Example usage for org.springframework.beans.factory ListableBeanFactory getAliases

List of usage examples for org.springframework.beans.factory ListableBeanFactory getAliases

Introduction

In this page you can find the example usage for org.springframework.beans.factory ListableBeanFactory getAliases.

Prototype

String[] getAliases(String name);

Source Link

Document

Return the aliases for the given bean name, if any.

Usage

From source file:org.pentaho.platform.plugin.services.pluginmgr.DefaultPluginManager.java

private Collection<String> getBeanIdsForType(String pluginId, Class<?> clazz) {
    ArrayList<String> ids = new ArrayList<String>();

    ListableBeanFactory fac = beanFactoryMap.get(pluginId).getBeanFactory();

    String[] names = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(fac, clazz);
    for (String beanName : names) {
        ids.add(beanName);/*from w  w w.  j a va2  s .c o m*/
        for (String beanAlias : fac.getAliases(beanName)) {
            ids.add(beanAlias);
        }
    }
    return ids;
}