List of usage examples for org.springframework.beans.factory BeanFactory isPrototype
boolean isPrototype(String name) throws NoSuchBeanDefinitionException;
From source file:org.shredzone.commons.taglib.proxy.AbstractTagProxy.java
/** * Creates a new instance of the implementing target bean. * * @param jspContext/*from w w w . j av a 2s . c o m*/ * {@link JspContext} */ @SuppressWarnings("unchecked") protected void initTargetBean(JspContext jspContext) { BeanFactory bf = getBeanFactory(jspContext); String beanName = getBeanName(); if (!bf.isPrototype(beanName)) { throw new IllegalStateException("Bean " + beanName + " must be prototype scoped!"); } tagImpl = (T) bf.getBean(beanName); }
From source file:org.kuali.rice.test.CompositeBeanFactory.java
@Override public boolean isPrototype(String name) throws NoSuchBeanDefinitionException { for (BeanFactory f : factories) { try {/*from w ww .j av a 2s .c o m*/ boolean b = f.isPrototype(name); if (b) { return b; } } catch (BeansException e) { LOG.info("bean exception", e); } } return false; }