java类org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor的实例源码

ApplicationManager.java 文件源码 项目:toolbox 阅读 25 收藏 0 点赞 0 评论 0
public void processInjection(Object bean) {
  AutowiredAnnotationBeanPostProcessor beanPostProcessor = new AutowiredAnnotationBeanPostProcessor();
  beanPostProcessor.setBeanFactory(getApplicationContext().getBeanFactory());
  beanPostProcessor.processInjection(bean);
}
ParallelTestRunner.java 文件源码 项目:parallel-test-runner 阅读 23 收藏 0 点赞 0 评论 0
private void injectOwnDependencies() {
    TestContext testContext = (TestContext) ReflectionTestUtils.getField(getTestContextManager(),
            TEST_CONTEXT_FIELD_IN_SPRING_JUNIT4_CLASS_RUNNER);
    ApplicationContext context = testContext.getApplicationContext();
    context.getBean(AutowiredAnnotationBeanPostProcessor.class).processInjection(this);
}
SpringMVCFactory.java 文件源码 项目:mocha-mvc 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    this.applicationContext = applicationContext;
    processer = new AutowiredAnnotationBeanPostProcessor();
    processer.setBeanFactory(applicationContext.getAutowireCapableBeanFactory());
}
AbstractSpringInjectContext.java 文件源码 项目:sdif4j 阅读 23 收藏 0 点赞 0 评论 0
public final void injectMembers(Object instance) {
    final AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
    bpp.setBeanFactory(getContext().getAutowireCapableBeanFactory());
    bpp.processInjection(instance);
}
PersistenceConfig.java 文件源码 项目:jsf-exmple 阅读 29 收藏 0 点赞 0 评论 0
@Bean
public static AutowiredAnnotationBeanPostProcessor autowiredAnnotationBeanPostProcessor() {
    return new AutowiredAnnotationBeanPostProcessor();
}
SpringBeanAutowiringSupport.java 文件源码 项目:lams 阅读 34 收藏 0 点赞 0 评论 0
/**
 * 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);
}
SpringBeanAutowiringSupport.java 文件源码 项目:spring4-understanding 阅读 35 收藏 0 点赞 0 评论 0
/**
 * 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);
}
DynamicDeployBeans.java 文件源码 项目:hyberbin-osgi 阅读 23 收藏 0 点赞 0 评论 0
public void removeInjectCache(String name) {

        AutowiredAnnotationBeanPostProcessor autowiredAnnotationBeanPostProcessor = ctx.getBean(AutowiredAnnotationBeanPostProcessor.class);

        Map<String, InjectionMetadata> injectionMetadataMap =  (Map<String, InjectionMetadata>) ReflectionUtils.getField(injectionMetadataCacheField, autowiredAnnotationBeanPostProcessor);

        injectionMetadataMap.remove(name);
    }
SpringBeanAutowiringSupport.java 文件源码 项目:class-guard 阅读 29 收藏 0 点赞 0 评论 0
/**
 * 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);
}
SpringBeanAutowiringInterceptor.java 文件源码 项目:lams 阅读 26 收藏 0 点赞 0 评论 0
/**
 * Template method for configuring the
 * {@link AutowiredAnnotationBeanPostProcessor} used for autowiring.
 * @param processor the AutowiredAnnotationBeanPostProcessor to configure
 * @param target the target bean to autowire with this processor
 */
protected void configureBeanPostProcessor(AutowiredAnnotationBeanPostProcessor processor, Object target) {
}


问题


面经


文章

微信
公众号

扫码关注公众号