List of usage examples for org.springframework.context ApplicationContext isSingleton
boolean isSingleton(String name) throws NoSuchBeanDefinitionException;
From source file:org.brushingbits.jnap.struts2.config.RestControllerConfigBuilder.java
@Override protected Set<Class> findActions() { Set<Class> classes = new HashSet<Class>(); final ApplicationContext ac = this.applicationContext; String[] beanNames = ac.getBeanDefinitionNames(); for (String beanName : beanNames) { // don't care for the bean itself right now, just it's class Class beanClass = ac.getType(beanName); // first of all, check for the @Controller annotation... // then, if it's inside the right package (base controllers package) if (beanClass.isAnnotationPresent(Controller.class) && beanClass.getPackage().getName().startsWith(this.packageLocatorsBasePackage)) { // we must warn in case of a singleton scoped controller if (ac.isSingleton(beanName)) { LOG.warn(""); // TODO }/*from ww w .jav a 2 s. co m*/ classes.add(beanClass); } } return classes; }