public static Object getBean ( String beanName ) { if ( null == beanName ) { return null ; } return applicationContext . getBean ( beanName ) ; }
This method is used to retrieve a bean by its name . Note that this may result in new bean creation if the scope is set to prototype in the bean configuration file .