Spring Framework ConfigurableBeanFactory - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ConfigurableBeanFactory class.

This code example shows how to use the following methods:getBeanExpressionResolver, resolveEmbeddedValue
	 */ 
	private Object resolveDefaultValue(String defaultValue) {
		if (this.configurableBeanFactory == null) {
			return defaultValue;
		} 
		String placeholdersResolved = this.configurableBeanFactory.resolveEmbeddedValue(defaultValue);
		BeanExpressionResolver exprResolver = this.configurableBeanFactory.getBeanExpressionResolver();
		if (exprResolver == null) {
			return defaultValue;
		} 
		return exprResolver.evaluate(placeholdersResolved, this.expressionContext);
	} 
 
	/** 
	 * Invoked when a named value is required, but {@link #resolveName(String, MethodParameter, NativeWebRequest)} 
	 * returned {@code null} and there is no default value. Subclasses typically throw an exception in this case. 
	 * @param name the name for the value 
	 * @param parameter the method parameter 
	 */ 
	protected abstract void handleMissingValue(String name, MethodParameter parameter) throws ServletException;
6
CodeRank
This code example shows how to use the following methods:getBean
	} 
 
 
	@Override 
	public Object getTargetObject() {
		return this.beanFactory.getBean(this.targetBeanName);
	} 
 
	@Override 
	public void removeFromScope() { 
		this.beanFactory.destroyScopedBean(this.targetBeanName);
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:getBeanClassLoader
	} 
 
	@Override 
	public ClassLoader getAspectClassLoader() {
		if (this.beanFactory instanceof ConfigurableBeanFactory) {
			return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader();
		} 
		else { 
			return ClassUtils.getDefaultClassLoader();
		} 
	} 
 
	@Override 
	public int getOrder() { 
		if (this.beanFactory.isSingleton(this.aspectBeanName) &&
				this.beanFactory.isTypeMatch(this.aspectBeanName, Ordered.class)) {
			return ((Ordered) this.beanFactory.getBean(this.aspectBeanName)).getOrder();
		} 
		return Ordered.LOWEST_PRECEDENCE;
	} 
6
CodeRank
This code example shows how to use the following methods:getBeanClassLoader
	} 
 
	@Override 
	public ClassLoader getAspectClassLoader() {
		if (this.beanFactory instanceof ConfigurableBeanFactory) {
			return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader();
		} 
		else { 
			return ClassUtils.getDefaultClassLoader();
		} 
	} 
 
	@Override 
	public AspectMetadata getAspectMetadata() {
		return this.aspectMetadata;
	} 
 
	/** 
	 * Determine the order for this factory's target aspect, either 
	 * an instance-specific order expressed through implementing the 
6
CodeRank
This code example shows how to use the following methods:resolveEmbeddedValue
This code example shows how to use the following methods:destroyBean
	protected void destroyPrototypeInstance(Object target) {
		if (this.logger.isDebugEnabled()) {
			this.logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'");
		} 
		if (getBeanFactory() instanceof ConfigurableBeanFactory) {
			((ConfigurableBeanFactory) getBeanFactory()).destroyBean(getTargetBeanName(), target);
		} 
		else if (target instanceof DisposableBean) {
			try { 
				((DisposableBean) target).destroy();
			} 
			catch (Throwable ex) {
				logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
			} 
		} 
	} 
 
 
	//--------------------------------------------------------------------- 
	// Serialization support 
5
CodeRank
This code example shows how to use the following methods:getBeanClassLoader
		} 
	} 
 
	private ClassLoader getBeanClassLoader() {
		return (beanFactory instanceof ConfigurableBeanFactory ?
				((ConfigurableBeanFactory) beanFactory).getBeanClassLoader() : ClassUtils.getDefaultClassLoader());
	} 
 
 
	/** 
	 * Actually publish the given endpoint. To be implemented by subclasses. 
	 * @param endpoint the JAX-WS Endpoint object 
	 * @param annotation the service bean's WebService annotation 
	 */ 
	protected abstract void publishEndpoint(Endpoint endpoint, WebService annotation);
 
	/** 
	 * Actually publish the given provider endpoint. To be implemented by subclasses. 
	 * @param endpoint the JAX-WS Provider Endpoint object 
	 * @param annotation the service bean's WebServiceProvider annotation 
5
CodeRank
See Code Examples for Spring Framework ConfigurableBeanFactory Methods: