Java 类org.springframework.context.annotation.ClassPathBeanDefinitionScanner 实例源码

项目:saluki    文件:MonitorAutoconfiguration.java   
@Bean
public BeanFactoryPostProcessor beanFactoryPostProcessor(ApplicationContext applicationContext) {
    return new BeanFactoryPostProcessor() {

        @Override
        public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
            if (beanFactory instanceof BeanDefinitionRegistry) {
                try {
                    BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;
                    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(registry);
                    scanner.setResourceLoader(applicationContext);
                    scanner.scan("com.quancheng.saluki.boot.web");
                } catch (Throwable e) {
                    log.error(e.getMessage(), e);
                }
            }

        }

    };
}
项目:spring4-understanding    文件:ClassPathBeanDefinitionScannerScopeIntegrationTests.java   
private ApplicationContext createContext(ScopedProxyMode scopedProxyMode) {
    GenericWebApplicationContext context = new GenericWebApplicationContext();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
    scanner.setIncludeAnnotationConfig(false);
    scanner.setBeanNameGenerator(new BeanNameGenerator() {
        @Override
        public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
            return definition.getScope();
        }
    });
    scanner.setScopedProxyMode(scopedProxyMode);

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.refresh();
    return context;
}
项目:ibole-microservice    文件:RpcAnnotation.java   
/**
* Scan{@link com.github.ibole.microservice.config.annotation.Reference} Annotation.
*/ 
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
    throws BeansException {
  if (StringUtils.isEmpty(annotationPackage)) {
    return;
  }
  if (beanFactory instanceof BeanDefinitionRegistry) {
    BeanDefinitionRegistry beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory;
    ClassPathBeanDefinitionScanner scanner =
        new ClassPathBeanDefinitionScanner(beanDefinitionRegistry, true);
    AnnotationTypeFilter filter = new AnnotationTypeFilter(Reference.class);
    scanner.addIncludeFilter(filter);
    scanner.scan(annotationPackages);
  }

}
项目:spring-data-dev-tools    文件:BootShim.java   
public BootShim(String[] args, ConfigurableApplicationContext context) {
    this.ctx = context;

    try {
        commandLine = SimpleShellCommandLineOptions.parseCommandLine(args);
    } catch (IOException var5) {
        throw new ShellException(var5.getMessage(), var5);
    }

    this.configureApplicationContext(this.ctx);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) this.ctx);
    if (commandLine.getDisableInternalCommands()) {
        scanner.scan(new String[] { "org.springframework.shell.converters", "org.springframework.shell.plugin.support" });
    } else {
        scanner.scan(new String[] { "org.springframework.shell.commands", "org.springframework.shell.converters",
                "org.springframework.shell.plugin.support" });
    }

}
项目:springshellwithboot    文件:BootShim.java   
public BootShim(String[] args, ConfigurableApplicationContext context) {
    this.ctx = context;

    try {
        commandLine = SimpleShellCommandLineOptions.parseCommandLine(args);
    } catch (IOException var5) {
        throw new ShellException(var5.getMessage(), var5);
    }

    this.configureApplicationContext(this.ctx);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) this.ctx);
    if(commandLine.getDisableInternalCommands()) {
        scanner.scan(new String[]{"org.springframework.shell.converters", "org.springframework.shell.plugin.support"});
    } else {
        scanner.scan(new String[]{"org.springframework.shell.commands", "org.springframework.shell.converters", "org.springframework.shell.plugin.support"});
    }

}
项目:daikon    文件:ServiceRegistrar.java   
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
    // Create the annotation-based context
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context, false);
    scanner.addIncludeFilter(new ServiceTypeFilter());
    final String basePackage = StringUtils.substringBeforeLast(importingClassMetadata.getClassName(), ".");
    scanner.scan(basePackage);
    // Import scanned services in current registry
    final String[] names = context.getBeanDefinitionNames();
    for (String name : names) {
        final BeanDefinition definition = context.getBeanDefinition(name);
        registry.registerBeanDefinition(name, definition);
    }

}
项目:class-guard    文件:ClassPathBeanDefinitionScannerScopeIntegrationTests.java   
private ApplicationContext createContext(ScopedProxyMode scopedProxyMode) {
    GenericWebApplicationContext context = new GenericWebApplicationContext();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
    scanner.setIncludeAnnotationConfig(false);
    scanner.setBeanNameGenerator(new BeanNameGenerator() {
        @Override
        public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
            return definition.getScope();
        }
    });
    scanner.setScopedProxyMode(scopedProxyMode);

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.refresh();
    return context;
}
项目:hdfs-shell    文件:BootShim.java   
public BootShim(String[] args, ConfigurableApplicationContext context) {
    this.ctx = context;
    try {
        commandLine = SimpleShellCommandLineOptions.parseCommandLine(args);
    } catch (IOException var5) {
        throw new ShellException(var5.getMessage(), var5);
    }
    this.configureApplicationContext(this.ctx);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) this.ctx);
    if (commandLine.getDisableInternalCommands()) {
        scanner.scan("org.springframework.shell.converters", "org.springframework.shell.plugin.support");
    } else {
        scanner.scan("org.springframework.shell.commands", "org.springframework.shell.converters", "org.springframework.shell.plugin.support");
    }
}
项目:wmz7year-rpc-framework    文件:Wmz7yearBeanPostProcessor.java   
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory arg0) throws BeansException {
    // TODO Auto-generated method stub
    TypeFilter filter = new AnnotationTypeFilter(Wmz7year.class);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) arg0,
            false);
    scanner.addIncludeFilter(filter);
    int scan = scanner.scan("com.wmz7year.main");
    System.out.println("scan:" + scan);
}
项目:spring4-understanding    文件:Spr8510Tests.java   
/**
 * Ensure that ContextLoaderListener and GenericWebApplicationContext interact nicely.
 */
@Test
public void genericWAC() {
    GenericWebApplicationContext ctx = new GenericWebApplicationContext();
    ContextLoaderListener cll = new ContextLoaderListener(ctx);

    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
    scanner.scan("bogus.pkg");

    cll.contextInitialized(new ServletContextEvent(new MockServletContext()));
}
项目:spring4-understanding    文件:ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java   
private ApplicationContext createContext(final ScopedProxyMode scopedProxyMode) {
    GenericWebApplicationContext context = new GenericWebApplicationContext();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
    scanner.setIncludeAnnotationConfig(false);
    scanner.setScopeMetadataResolver(new ScopeMetadataResolver() {
        @Override
        public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
            ScopeMetadata metadata = new ScopeMetadata();
            if (definition instanceof AnnotatedBeanDefinition) {
                AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;
                for (String type : annDef.getMetadata().getAnnotationTypes()) {
                    if (type.equals(javax.inject.Singleton.class.getName())) {
                        metadata.setScopeName(BeanDefinition.SCOPE_SINGLETON);
                        break;
                    }
                    else if (annDef.getMetadata().getMetaAnnotationTypes(type).contains(javax.inject.Scope.class.getName())) {
                        metadata.setScopeName(type.substring(type.length() - 13, type.length() - 6).toLowerCase());
                        metadata.setScopedProxyMode(scopedProxyMode);
                        break;
                    }
                    else if (type.startsWith("javax.inject")) {
                        metadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
                    }
                }
            }
            return metadata;
        }
    });

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.registerAlias("classPathBeanDefinitionScannerJsr330ScopeIntegrationTests.SessionScopedTestBean", "session");
    context.refresh();
    return context;
}
项目:spring4-understanding    文件:EnvironmentSystemIntegrationTests.java   
@Test
public void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedConfigClasses() {
    // it's actually ConfigurationClassPostProcessor's Environment that gets the job done here.
    GenericApplicationContext ctx = new GenericApplicationContext();
    ctx.setEnvironment(prodEnv);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
    scanner.scan("org.springframework.core.env.scan1");
    ctx.refresh();
    assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
    assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
}
项目:spring4-understanding    文件:EnvironmentSystemIntegrationTests.java   
@Test
public void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedComponents() {
    GenericApplicationContext ctx = new GenericApplicationContext();
    ctx.setEnvironment(prodEnv);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
    scanner.scan("org.springframework.core.env.scan2");
    ctx.refresh();
    assertThat(scanner.getEnvironment(), is((Environment)ctx.getEnvironment()));
    assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
    assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:BeanDefinitionLoader.java   
/**
 * Create a new {@link BeanDefinitionLoader} that will load beans into the specified
 * {@link BeanDefinitionRegistry}.
 * @param registry the bean definition registry that will contain the loaded beans
 * @param sources the bean sources
 */
BeanDefinitionLoader(BeanDefinitionRegistry registry, Object... sources) {
    Assert.notNull(registry, "Registry must not be null");
    Assert.notEmpty(sources, "Sources must not be empty");
    this.sources = sources;
    this.annotatedReader = new AnnotatedBeanDefinitionReader(registry);
    this.xmlReader = new XmlBeanDefinitionReader(registry);
    if (isGroovyPresent()) {
        this.groovyReader = new GroovyBeanDefinitionReader(registry);
    }
    this.scanner = new ClassPathBeanDefinitionScanner(registry);
    this.scanner.addExcludeFilter(new ClassExcludeFilter(sources));
}
项目:spring-boot-concourse    文件:BeanDefinitionLoader.java   
/**
 * Create a new {@link BeanDefinitionLoader} that will load beans into the specified
 * {@link BeanDefinitionRegistry}.
 * @param registry the bean definition registry that will contain the loaded beans
 * @param sources the bean sources
 */
BeanDefinitionLoader(BeanDefinitionRegistry registry, Object... sources) {
    Assert.notNull(registry, "Registry must not be null");
    Assert.notEmpty(sources, "Sources must not be empty");
    this.sources = sources;
    this.annotatedReader = new AnnotatedBeanDefinitionReader(registry);
    this.xmlReader = new XmlBeanDefinitionReader(registry);
    if (isGroovyPresent()) {
        this.groovyReader = new GroovyBeanDefinitionReader(registry);
    }
    this.scanner = new ClassPathBeanDefinitionScanner(registry);
    this.scanner.addExcludeFilter(new ClassExcludeFilter(sources));
}
项目:contestparser    文件:BeanDefinitionLoader.java   
/**
 * Create a new {@link BeanDefinitionLoader} that will load beans into the specified
 * {@link BeanDefinitionRegistry}.
 * @param registry the bean definition registry that will contain the loaded beans
 * @param sources the bean sources
 */
BeanDefinitionLoader(BeanDefinitionRegistry registry, Object... sources) {
    Assert.notNull(registry, "Registry must not be null");
    Assert.notEmpty(sources, "Sources must not be empty");
    this.sources = sources;
    this.annotatedReader = new AnnotatedBeanDefinitionReader(registry);
    this.xmlReader = new XmlBeanDefinitionReader(registry);
    if (isGroovyPresent()) {
        this.groovyReader = new GroovyBeanDefinitionReader(registry);
    }
    this.scanner = new ClassPathBeanDefinitionScanner(registry);
    this.scanner.addExcludeFilter(new ClassExcludeFilter(sources));
}
项目:msf4j    文件:MSF4JSpringApplication.java   
/**
 * This will add a given service class to the running instance with given base path.
 *
 * @param configurableApplicationContext ConfigurableApplicationContext of running app
 * @param serviceClass                   Service class
 * @param basePath                       Base path to which the service get registered
 */
public SpringMicroservicesRunner addService(ConfigurableApplicationContext configurableApplicationContext,
                                            Class<?> serviceClass, String basePath) {
    ClassPathBeanDefinitionScanner classPathBeanDefinitionScanner =
            new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) configurableApplicationContext);
    classPathBeanDefinitionScanner.scan(serviceClass.getPackage().getName());
    SpringMicroservicesRunner springMicroservicesRunner =
            configurableApplicationContext.getBean(SpringMicroservicesRunner.class);
    springMicroservicesRunner.deploy(basePath, configurableApplicationContext.getBean(serviceClass));
    return springMicroservicesRunner;
}
项目:spring-component-framework    文件:ApplicationFeatureResolver.java   
private void scanAppRepository(AbstractApplicationContext context, Component component) {
    String appRepository = component.getManifestAttribute(APP_REPOSITORY);
    if (StringUtils.isEmpty(appRepository)) {
        return;
    }
    int count;
    if (context instanceof AnnotationConfigRegistry) {
        int before = context.getBeanDefinitionCount();
        ((AnnotationConfigRegistry) context).scan(StringUtils.split(appRepository, CONFIG_LOCATION_DELIMITERS));
        count = context.getBeanDefinitionCount() - before;
    } else {
        ClassPathBeanDefinitionScanner scanner =
                new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) context);
        scanner.setEnvironment(context.getEnvironment());
        scanner.setResourceLoader(context);
        scanner.setIncludeAnnotationConfig(false);
        count = scanner.scan(StringUtils.split(appRepository, CONFIG_LOCATION_DELIMITERS));
    }
    if (count > 0 && logger.isDebugEnabled()) {
        logger.debug("Scanned {} beans in {}", count, component.getDisplayName());
        String[] names = context.getBeanDefinitionNames();
        for (String name : names) {
            BeanDefinition definition = ((GenericApplicationContext) context).getBeanDefinition(name);
            if (definition instanceof ScannedGenericBeanDefinition) {
                ScannedGenericBeanDefinition sgbd = (ScannedGenericBeanDefinition) definition;
                Class<?> beanClass;
                try {
                    beanClass = sgbd.resolveBeanClass(context.getClassLoader());
                } catch (ClassNotFoundException e) {
                    continue;
                }
                if (beanClass != null) {
                    logger.debug("\t{}", beanClass.getName());
                }
            }
        }
    }

}
项目:class-guard    文件:Spr8510Tests.java   
/**
 * Ensure that ContextLoaderListener and GenericWebApplicationContext interact nicely.
 */
@Test
public void genericWAC() {
    GenericWebApplicationContext ctx = new GenericWebApplicationContext();
    ContextLoaderListener cll = new ContextLoaderListener(ctx);

    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
    scanner.scan("bogus.pkg");

    cll.contextInitialized(new ServletContextEvent(new MockServletContext()));
}
项目:class-guard    文件:ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java   
private ApplicationContext createContext(final ScopedProxyMode scopedProxyMode) {
    GenericWebApplicationContext context = new GenericWebApplicationContext();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
    scanner.setIncludeAnnotationConfig(false);
    scanner.setScopeMetadataResolver(new ScopeMetadataResolver() {
        @Override
        public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
            ScopeMetadata metadata = new ScopeMetadata();
            if (definition instanceof AnnotatedBeanDefinition) {
                AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;
                for (String type : annDef.getMetadata().getAnnotationTypes()) {
                    if (type.equals(javax.inject.Singleton.class.getName())) {
                        metadata.setScopeName(BeanDefinition.SCOPE_SINGLETON);
                        break;
                    }
                    else if (annDef.getMetadata().getMetaAnnotationTypes(type).contains(javax.inject.Scope.class.getName())) {
                        metadata.setScopeName(type.substring(type.length() - 13, type.length() - 6).toLowerCase());
                        metadata.setScopedProxyMode(scopedProxyMode);
                        break;
                    }
                    else if (type.startsWith("javax.inject")) {
                        metadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
                    }
                }
            }
            return metadata;
        }
    });

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.registerAlias("classPathBeanDefinitionScannerJsr330ScopeIntegrationTests.SessionScopedTestBean", "session");
    context.refresh();
    return context;
}
项目:class-guard    文件:EnvironmentIntegrationTests.java   
@Test
public void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedConfigClasses() {
    // it's actually ConfigurationClassPostProcessor's Environment that gets the job done here.
    GenericApplicationContext ctx = new GenericApplicationContext();
    ctx.setEnvironment(prodEnv);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
    scanner.scan("org.springframework.core.env.scan1");
    ctx.refresh();
    assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
    assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
}
项目:class-guard    文件:EnvironmentIntegrationTests.java   
@Test
public void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedComponents() {
    GenericApplicationContext ctx = new GenericApplicationContext();
    ctx.setEnvironment(prodEnv);
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
    scanner.scan("org.springframework.core.env.scan2");
    ctx.refresh();
    assertThat(scanner.getEnvironment(), is((Environment)ctx.getEnvironment()));
    assertThat(ctx.containsBean(DEV_BEAN_NAME), is(false));
    assertThat(ctx.containsBean(PROD_BEAN_NAME), is(true));
}
项目:HotswapAgent    文件:XmlBeanDefinationScannerAgent.java   
private XmlBeanDefinationScannerAgent(BeanDefinitionReader reader) {
    this.reader = reader;

    if (SpringPlugin.basePackagePrefixes != null && !basePackageInited) {
        ClassPathBeanDefinitionScannerAgent xmlBeanDefinitionScannerAgent = ClassPathBeanDefinitionScannerAgent.getInstance(new ClassPathBeanDefinitionScanner(reader.getRegistry()));
        for (String basePackage : SpringPlugin.basePackagePrefixes) {
            xmlBeanDefinitionScannerAgent.registerBasePackage(basePackage);
        }
        basePackageInited = true;
    }
}
项目:springboot-analysis    文件:SpringEmbeddedProviderTest.java   
@Test
public void testClassPathBeanDefinitionScanner() {
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(beanDefinitionRegistry);
    scanner.scan("spring.study.componentprovider.bean");
}
项目:dwr    文件:AnnotationScannerParser.java   
public BeanDefinition parse(Element element, ParserContext parserContext)
{
    ClassPathBeanDefinitionScanner scanner = new DwrClassPathBeanDefinitionScanner(parserContext.getRegistry());
    String basePackage = element.getAttribute("base-package");
    // Override - By default Spring uses a name generator that uses AnnotationBeanNameGenerator which uses the name specified on the Component
    // annotation and if not present uses the simple name.  Since our annotation-scanner doesn't scan @Component if two classes with the
    // same simple name exist in different packages there will be issues.  See https://directwebremoting.atlassian.net/browse/DWR-651.
    scanner.setBeanNameGenerator(new DefaultBeanNameGenerator());
    if (!hasText(basePackage))
    {
        if (log.isInfoEnabled())
        {
            log.info("No base package defined for classpath scanning. Traversing the whole JVM classpath");
        }
    }
    String regex = element.getAttribute("regex");
    if (hasText(regex))
    {
        scanner.addIncludeFilter(new RegexPatternTypeFilter(Pattern.compile(regex)));
    }
    String proxies = element.getAttribute("scanRemoteProxy");
    if (hasText(proxies) && ("TRUE".equals(proxies.toUpperCase()) || "FALSE".equals(proxies.toUpperCase())))
    {
        scanProxies = Boolean.parseBoolean(proxies);
    }
    if (scanProxies)
    {
        scanner.addIncludeFilter(new AnnotationTypeFilter(RemoteProxy.class));
    }
    String conv = element.getAttribute("scanDataTransferObject");
    if (hasText(conv) && ("TRUE".equals(conv.toUpperCase()) || "FALSE".equals(conv.toUpperCase())))
    {
        scanConverters = Boolean.parseBoolean(conv);
    }
    if (scanConverters)
    {
        scanner.addIncludeFilter(new AnnotationTypeFilter(DataTransferObject.class));
    }
    String filters = element.getAttribute("scanGlobalFilter");
    if (hasText(filters) && ("TRUE".equals(filters.toUpperCase()) || "FALSE".equals(filters.toUpperCase())))
    {
        scanFilters = Boolean.parseBoolean(filters);
    }
    if (scanFilters)
    {
        scanner.addIncludeFilter(new AnnotationTypeFilter(GlobalFilter.class));
    }
    if (scanProxies | scanConverters | scanFilters)
    {
        scanner.scan(basePackage == null ? "" : basePackage);
    }
    else
    {
        log.warn("Scan is not required if all @RemoteProxy, @DataTransferObject and @GlobalFilter are disabled. Skipping detection");
    }
    return null;
}
项目:elasticactors    文件:AnnotationConfigApplicationContext.java   
/**
 * Create a new AnnotationConfigApplicationContext that needs to be populated
 * through {@link #register} calls and then manually {@linkplain #refresh refreshed}.
 */
public AnnotationConfigApplicationContext() {
    this.reader = new AnnotatedBeanDefinitionReader(this);
    this.scanner = new ClassPathBeanDefinitionScanner(this);
}
项目:spring4-understanding    文件:AnnotationConfigWebApplicationContext.java   
/**
 * Build a {@link ClassPathBeanDefinitionScanner} for the given bean factory.
 * <p>This should be pre-configured with the {@code Environment} (if desired)
 * but not with a {@code BeanNameGenerator} or {@code ScopeMetadataResolver} yet.
 * @param beanFactory the bean factory to load bean definitions into
 * @since 4.1.9
 * @see #getEnvironment()
 * @see #getBeanNameGenerator()
 * @see #getScopeMetadataResolver()
 */
protected ClassPathBeanDefinitionScanner getClassPathBeanDefinitionScanner(DefaultListableBeanFactory beanFactory) {
    return new ClassPathBeanDefinitionScanner(beanFactory, true, getEnvironment());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AnnotationConfigEmbeddedWebApplicationContext.java   
/**
 * Create a new {@link AnnotationConfigEmbeddedWebApplicationContext} that needs to be
 * populated through {@link #register} calls and then manually {@linkplain #refresh
 * refreshed}.
 */
public AnnotationConfigEmbeddedWebApplicationContext() {
    this.reader = new AnnotatedBeanDefinitionReader(this);
    this.scanner = new ClassPathBeanDefinitionScanner(this);
}
项目:spring-boot-concourse    文件:AnnotationConfigEmbeddedWebApplicationContext.java   
/**
 * Create a new {@link AnnotationConfigEmbeddedWebApplicationContext} that needs to be
 * populated through {@link #register} calls and then manually {@linkplain #refresh
 * refreshed}.
 */
public AnnotationConfigEmbeddedWebApplicationContext() {
    this.reader = new AnnotatedBeanDefinitionReader(this);
    this.scanner = new ClassPathBeanDefinitionScanner(this);
}
项目:contestparser    文件:AnnotationConfigEmbeddedWebApplicationContext.java   
/**
 * Create a new {@link AnnotationConfigEmbeddedWebApplicationContext} that needs to be
 * populated through {@link #register} calls and then manually {@linkplain #refresh
 * refreshed}.
 */
public AnnotationConfigEmbeddedWebApplicationContext() {
    this.reader = new AnnotatedBeanDefinitionReader(this);
    this.scanner = new ClassPathBeanDefinitionScanner(this);
}