Example usage for org.springframework.beans.factory.support DefaultListableBeanFactory initializeBean

List of usage examples for org.springframework.beans.factory.support DefaultListableBeanFactory initializeBean

Introduction

In this page you can find the example usage for org.springframework.beans.factory.support DefaultListableBeanFactory initializeBean.

Prototype

@Override
    public Object initializeBean(Object existingBean, String beanName) 

Source Link

Usage

From source file:com.extjs.djn.spring.loader.SpringLoaderHelper.java

/**
 * Allow to autowired a non spring instanciated object
 * /*w  w  w.  j  ava 2s.  c om*/
 * @param objToLoad
 * @param prefixBeanName
 */
public static void autowireBean(Object objToLoad, String prefixBeanName) {
    DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) ContextLoader
            .getCurrentWebApplicationContext().getAutowireCapableBeanFactory();
    beanFactory.autowireBeanProperties(objToLoad, AutowireCapableBeanFactory.AUTOWIRE_NO, false);
    beanFactory.initializeBean(objToLoad, prefixBeanName);
}