当前位置: 首页>>代码示例>>Java>>正文


Java AutowiredAnnotationBeanPostProcessor.processInjection方法代码示例

本文整理汇总了Java中org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.processInjection方法的典型用法代码示例。如果您正苦于以下问题:Java AutowiredAnnotationBeanPostProcessor.processInjection方法的具体用法?Java AutowiredAnnotationBeanPostProcessor.processInjection怎么用?Java AutowiredAnnotationBeanPostProcessor.processInjection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor的用法示例。


在下文中一共展示了AutowiredAnnotationBeanPostProcessor.processInjection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processInjectionBasedOnCurrentContext

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
/**
 * Process {@code @Autowired} injection for the given target object,
 * based on the current web application context.
 * <p>Intended for use as a delegate.
 * @param target the target object to process
 * @see org.springframework.web.context.ContextLoader#getCurrentWebApplicationContext()
 */
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.");
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:SpringBeanAutowiringSupport.java

示例2: doAutowireBean

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
/**
 * Actually autowire the target bean after construction/passivation.
 * @param target the target bean to autowire
 */
protected void doAutowireBean(Object target) {
	AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
	configureBeanPostProcessor(bpp, target);
	bpp.setBeanFactory(getBeanFactory(target));
	bpp.processInjection(target);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:SpringBeanAutowiringInterceptor.java

示例3: UserRegistrationSteps

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
public UserRegistrationSteps() {
	super();
	SpringApplication application = new SpringApplication(
			RegistrationApplication.class);
	application.setWebEnvironment(false);
	AutowiredAnnotationBeanPostProcessor autowiredAnnotationBeanPostProcessor = new AutowiredAnnotationBeanPostProcessor();
	autowiredAnnotationBeanPostProcessor.setBeanFactory(application.run()
			.getBeanFactory());
	autowiredAnnotationBeanPostProcessor.processInjection(this);
}
 
开发者ID:ewolff,项目名称:user-registration-V2,代码行数:11,代码来源:UserRegistrationSteps.java

示例4: onStart

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
@Override
public void onStart(Application application) {
  AutowiredAnnotationBeanPostProcessor beanPostProcessor =
      new AutowiredAnnotationBeanPostProcessor();
  beanPostProcessor.setBeanFactory(getApplicationContext(application).getBeanFactory());
  beanPostProcessor.processInjection(this);
}
 
开发者ID:tfeng,项目名称:play-plugins,代码行数:8,代码来源:SpringGlobalSettings.java

示例5: onStart

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
@Override
public void onStart() {
  AutowiredAnnotationBeanPostProcessor beanPostProcessor =
      new AutowiredAnnotationBeanPostProcessor();
  beanPostProcessor.setBeanFactory(getApplicationContext().getBeanFactory());
  beanPostProcessor.processInjection(this);
}
 
开发者ID:tfeng,项目名称:play-plugins,代码行数:8,代码来源:AbstractPlugin.java

示例6: processInjection

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
public void processInjection(Object bean) {
  AutowiredAnnotationBeanPostProcessor beanPostProcessor = new AutowiredAnnotationBeanPostProcessor();
  beanPostProcessor.setBeanFactory(getApplicationContext().getBeanFactory());
  beanPostProcessor.processInjection(bean);
}
 
开发者ID:tfeng,项目名称:toolbox,代码行数:6,代码来源:ApplicationManager.java

示例7: injectMembers

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
public final void injectMembers(Object instance) {
	final AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
	bpp.setBeanFactory(getContext().getAutowireCapableBeanFactory());
	bpp.processInjection(instance);
}
 
开发者ID:sdif4j,项目名称:sdif4j,代码行数:6,代码来源:AbstractSpringInjectContext.java

示例8: processInjectionBasedOnServletContext

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor; //导入方法依赖的package包/类
/**
 * Process {@code @Autowired} injection for the given target object,
 * based on the current root web application context as stored in the ServletContext.
 * <p>Intended for use as a delegate.
 * @param target the target object to process
 * @param servletContext the ServletContext to find the Spring web application context in
 * @see WebApplicationContextUtils#getWebApplicationContext(javax.servlet.ServletContext)
 */
public static void processInjectionBasedOnServletContext(Object target, ServletContext servletContext) {
	Assert.notNull(target, "Target object must not be null");
	WebApplicationContext cc = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
	AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
	bpp.setBeanFactory(cc.getAutowireCapableBeanFactory());
	bpp.processInjection(target);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:SpringBeanAutowiringSupport.java


注:本文中的org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.processInjection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。