Code example for AutowiredAnnotationBeanPostProcessor

Methods: processInjectionsetBeanFactory

1
	 */ 
	public static void processInjectionBasedOnCurrentContext(Object target) { 
		Assert.notNull(target, "Target object must not be null"); 
		WebApplicationContext cc = ContextLoader.getCurrentWebApplicationContext(); 
		if (cc != null) { 
			AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor(); 
			bpp.setBeanFactory(cc.getAutowireCapableBeanFactory()); 
			bpp.processInjection(target); 
		} 
		else { 
			if (logger.isDebugEnabled()) { 
				logger.debug("Current WebApplicationContext is not available for processing of " + 
						ClassUtils.getShortName(target.getClass()) + ": " + 
						"Make sure this class gets constructed in a Spring web application. Proceeding without injection."); 
			} 
		} 
	} 
 
 
	/**