Project

General

Profile

1
package eu.dnetlib.data.mdstore.modular.action;
2

    
3
import java.util.Map;
4

    
5
import org.springframework.beans.BeansException;
6
import org.springframework.beans.factory.BeanFactory;
7
import org.springframework.beans.factory.BeanFactoryAware;
8
import org.springframework.beans.factory.ListableBeanFactory;
9

    
10
public class MDStorePluginEnumerator implements BeanFactoryAware {
11

    
12
	// private static final Log log = LogFactory.getLog(MDStorePluginEnumerator.class); // NOPMD by marko on 11/24/08 5:02 PM
13

    
14
	/**
15
	 * bean factory.
16
	 */
17
	private ListableBeanFactory beanFactory;
18

    
19
	@Override
20
	public void setBeanFactory(final BeanFactory beanFactory) throws BeansException {
21
		this.beanFactory = (ListableBeanFactory) beanFactory;
22
	}
23

    
24
	/**
25
	 * Get all beans implementing the MDStorePlugin interface.
26
	 *
27
	 * @return
28
	 */
29
	public Map<String, MDStorePlugin> getAll() {
30
		return beanFactory.getBeansOfType(MDStorePlugin.class);
31
	}
32

    
33
}
(10-10/11)