org.springframework.boot.autoconfigure.AutoConfigurationPackages Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.AutoConfigurationPackages. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: AsyncDao   Author: twogoods   File: MapperScannerRegistryConfigurer.java    License: MIT License 6 votes vote down vote up
@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry) throws BeansException {
    log.debug("Searching for mappers annotated with @Mapper");

    ClassPathMapperScanner scanner = new ClassPathMapperScanner(beanDefinitionRegistry);
    try {
        if (this.applicationContext != null) {
            scanner.setResourceLoader(this.applicationContext);
        }
        List<String> packages = AutoConfigurationPackages.get(this.applicationContext);
        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        log.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #2
Source Project: AsyncDao   Author: twogoods   File: MapperScannerConfigurer.java    License: MIT License 6 votes vote down vote up
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
    log.debug("Searching for mappers annotated with @Mapper");
    ClassPathMapperScanner scanner = new ClassPathMapperScanner((BeanDefinitionRegistry) beanFactory);
    try {
        if (this.applicationContext != null) {
            scanner.setResourceLoader(applicationContext);
        }
        List<String> packages = AutoConfigurationPackages.get(beanFactory);
        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        log.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #3
Source Project: AsyncDao   Author: twogoods   File: AutoConfiguredMapperScannerRegistrar.java    License: MIT License 6 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
    log.debug("Searching for mappers annotated with @Mapper");
    ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }
        String[] packages;
        Environment env = beanFactory.getBean(Environment.class);
        String basePackages = env.getProperty("async.dao.basePackages");
        if (StringUtils.isEmpty(basePackages)) {
            packages = StringUtils.toStringArray(AutoConfigurationPackages.get(this.beanFactory));
        } else {
            packages = basePackages.split(",");
        }
        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(packages);
    } catch (IllegalStateException ex) {
        log.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #4
Source Project: faster-framework-project   Author: faster-framework   File: GRpcClientRegister.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
    AnnotationAttributes annotationAttributes = AnnotationAttributes.fromMap(importingClassMetadata.getAnnotationAttributes(GRpcClientScan.class.getCanonicalName()));
    if (annotationAttributes == null) {
        log.warn("GrpcScan was not found.Please check your configuration.");
        return;
    }
    ClassPathGRpcServiceScanner classPathGrpcServiceScanner = new ClassPathGRpcServiceScanner(registry, beanFactory);
    classPathGrpcServiceScanner.setResourceLoader(this.resourceLoader);
    classPathGrpcServiceScanner.addIncludeFilter(new AnnotationTypeFilter(GRpcService.class));
    List<String> basePackages = AutoConfigurationPackages.get(this.beanFactory);
    for (String pkg : annotationAttributes.getStringArray("basePackages")) {
        if (StringUtils.hasText(pkg)) {
            basePackages.add(pkg);
        }
    }
    classPathGrpcServiceScanner.doScan(StringUtils.toStringArray(basePackages));
}
 
Example #5
Source Project: faster-framework-project   Author: faster-framework   File: GRpcApiRegister.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
    AnnotationAttributes annotationAttributes = AnnotationAttributes.fromMap(importingClassMetadata.getAnnotationAttributes(GRpcServerScan.class.getCanonicalName()));
    if (annotationAttributes == null) {
        log.warn("GrpcScan was not found.Please check your configuration.");
        return;
    }
    ClassPathBeanDefinitionScanner classPathGrpcApiScanner = new ClassPathBeanDefinitionScanner(registry, false);
    classPathGrpcApiScanner.setResourceLoader(this.resourceLoader);
    classPathGrpcApiScanner.addIncludeFilter(new AnnotationTypeFilter(GRpcApi.class));
    List<String> basePackages = AutoConfigurationPackages.get(this.beanFactory);
    for (String pkg : annotationAttributes.getStringArray("basePackages")) {
        if (StringUtils.hasText(pkg)) {
            basePackages.add(pkg);
        }
    }
    classPathGrpcApiScanner.scan(StringUtils.toStringArray(basePackages));
}
 
Example #6
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

    logger.debug("Searching for mappers annotated with @Mapper");

    ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);

    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }

        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (logger.isDebugEnabled()) {
            for (String pkg : packages) {
                logger.debug("Using auto-configuration base package '" + pkg + "'");
            }
        }

        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled." + ex);
    }
}
 
Example #7
Source Project: mapper-boot-starter   Author: abel533   File: MapperAutoConfiguration.java    License: MIT License 6 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

    logger.debug("Searching for mappers annotated with @Mapper");

    ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
    scanner.setMapperProperties(environment);
    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }

        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (logger.isDebugEnabled()) {
            for (String pkg : packages) {
                logger.debug("Using auto-configuration base package '{}'", pkg);
            }
        }

        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #8
Source Project: loc-framework   Author: lord-of-code   File: LocMybatisAutoConfiguration.java    License: MIT License 6 votes vote down vote up
private void createClassPathMapperScanner(BeanDefinitionRegistry registry, String prefixName) {
  ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);

  try {
    if (this.resourceLoader != null) {
      scanner.setResourceLoader(this.resourceLoader);
    }

    List<String> packages = AutoConfigurationPackages.get(beanFactory);
    packages.forEach(pkg -> log.info("Using auto-configuration base package '{}'", pkg));

    scanner.setAnnotationClass(Mapper.class);
    scanner.setSqlSessionFactoryBeanName(prefixName + "SessionFactory");
    scanner.registerFilters();
    scanner.doScan(StringUtils.toStringArray(packages));
  } catch (IllegalStateException ex) {
    log.info("Could not determine auto-configuration package", ex);
  }
}
 
Example #9
@SuppressWarnings("unused")
@Override
protected AbstractFunctionExecutionConfigurationSource newAnnotationBasedFunctionExecutionConfigurationSource(
		AnnotationMetadata annotationMetadata) {

	StandardAnnotationMetadata metadata =
		new StandardAnnotationMetadata(getConfiguration(), true);

	return new AnnotationFunctionExecutionConfigurationSource(metadata) {

		@Override
		public Iterable<String> getBasePackages() {
			return AutoConfigurationPackages.get(getBeanFactory());
		}
	};
}
 
Example #10
Source Project: mapper-boot-starter   Author: abel533   File: MapperAutoConfiguration.java    License: MIT License 6 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

    logger.debug("Searching for mappers annotated with @Mapper");

    ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
    scanner.setMapperProperties(environment);
    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }

        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (logger.isDebugEnabled()) {
            for (String pkg : packages) {
                logger.debug("Using auto-configuration base package '{}'", pkg);
            }
        }

        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #11
Source Project: sdn-rx   Author: neo4j   File: TestAutoConfigurationPackageRegistrar.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata metadata,
	BeanDefinitionRegistry registry) {
	AnnotationAttributes attributes = AnnotationAttributes
		.fromMap(metadata.getAnnotationAttributes(
			TestAutoConfigurationPackage.class.getName(), true));
	AutoConfigurationPackages.register(registry,
		ClassUtils.getPackageName(attributes.getString("value")));
}
 
Example #12
Source Project: beihu-boot   Author: beihu-stack   File: ApiBootMyBatisEnhanceAutoConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

    logger.debug("Searching for mappers based with EnhanceMapper.class");
    // 重写扫描实现类
    // 将扫描到的每一个类
    EnhanceClassPathMapperScanner scanner = new EnhanceClassPathMapperScanner(registry);
    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }

        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (logger.isDebugEnabled()) {
            for (String pkg : packages) {
                logger.debug("Using auto-configuration base package '{}'", pkg);
            }
        }
        // 通过标记的父接口扫描
        scanner.setMarkerInterface(EnhanceMapper.class);
        // 通过注解形式扫描
        //scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #13
/**
 * 开启上报节点触发器列表线程
 */
private void startHeartSync() {
    // 使用配置文件配置的路径
    String jobBasePackage = jobNodeProperties.getJobBasePackage();
    // 如果并未配置,则使用springboot默认扫描的package
    if (StringUtils.isEmpty(jobBasePackage)) {
        jobBasePackage = AutoConfigurationPackages.get(beanFactory).get(0);
    }
    // 开启心跳检查,每隔5秒执行同步一次
    JobThread.scheduleWithFixedDelay(new HeartSyncRunnable(heartSyncService, jobNodeProperties, jobBasePackage), jobNodeProperties.getSendHeartInitialDelay(), jobNodeProperties.getSendHeartSyncTime());
}
 
Example #14
Source Project: springdoc-openapi   Author: springdoc   File: OpenAPIBuilder.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Gets open api definition.
 *
 * @return the open api definition
 */
private Optional<OpenAPIDefinition> getOpenAPIDefinition() {
	// Look for OpenAPIDefinition in a spring managed bean
	Map<String, Object> openAPIDefinitionMap = context.getBeansWithAnnotation(OpenAPIDefinition.class);
	OpenAPIDefinition apiDef = null;
	if (openAPIDefinitionMap.size() > 1)
		LOGGER.warn(
				"found more than one OpenAPIDefinition class. springdoc-openapi will be using the first one found.");
	if (openAPIDefinitionMap.size() > 0) {
		Map.Entry<String, Object> entry = openAPIDefinitionMap.entrySet().iterator().next();
		Class<?> objClz = entry.getValue().getClass();
		apiDef = AnnotatedElementUtils.findMergedAnnotation(objClz, OpenAPIDefinition.class);
	}

	// Look for OpenAPIDefinition in the spring classpath
	else {
		ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(
				false);
		scanner.addIncludeFilter(new AnnotationTypeFilter(OpenAPIDefinition.class));
		if (AutoConfigurationPackages.has(context)) {
			List<String> packagesToScan = AutoConfigurationPackages.get(context);
			apiDef = getApiDefClass(scanner, packagesToScan);
		}

	}
	return Optional.ofNullable(apiDef);
}
 
Example #15
Source Project: seata-samples   Author: seata   File: MybatisPlusAutoConfig.java    License: Apache License 2.0 5 votes vote down vote up
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
    MybatisPlusAutoConfig.logger.debug("Searching for mappers annotated with @Mapper");
    ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);

    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }

        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (MybatisPlusAutoConfig.logger.isDebugEnabled()) {
            Iterator iterator = packages.iterator();

            while(iterator.hasNext()) {
                String pkg = (String)iterator.next();
                MybatisPlusAutoConfig.logger.debug("Using auto-configuration base package '" + pkg + "'");
            }
        }

        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException var7) {
        MybatisPlusAutoConfig.logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled." + var7);
    }

}
 
Example #16
Source Project: seata-samples   Author: seata   File: MybatisPlusAutoConfig.java    License: Apache License 2.0 5 votes vote down vote up
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
    MybatisPlusAutoConfig.logger.debug("Searching for mappers annotated with @Mapper");
    ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);

    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }

        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (MybatisPlusAutoConfig.logger.isDebugEnabled()) {
            Iterator iterator = packages.iterator();

            while(iterator.hasNext()) {
                String pkg = (String)iterator.next();
                MybatisPlusAutoConfig.logger.debug("Using auto-configuration base package '" + pkg + "'");
            }
        }

        scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException var7) {
        MybatisPlusAutoConfig.logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled." + var7);
    }

}
 
Example #17
Source Project: api-boot   Author: minbox-projects   File: HttpMessageConverterAutoConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * http message converter fastjson实现实例
 * 通过fastjson方式进行格式化返回json字符串
 *
 * @return http message converter
 */
@Bean
@ConditionalOnMissingBean
HttpMessageConverters fastJsonHttpMessageConverters() {
    FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
    //创建fastJson配置实体类
    FastJsonConfig fastJsonConfig = new FastJsonConfig();
    fastJsonConfig.setSerializerFeatures(
            SerializerFeature.DisableCircularReferenceDetect,
            SerializerFeature.WriteMapNullValue,
            SerializerFeature.WriteNullListAsEmpty,
            SerializerFeature.WriteNullStringAsEmpty,
            SerializerFeature.WriteNullNumberAsZero,
            SerializerFeature.WriteDateUseDateFormat,
            SerializerFeature.WriteNullBooleanAsFalse
    );

    // get customer define value filters
    List<String> packages = AutoConfigurationPackages.get(beanFactory);
    // get plugin define value filters
    packages.addAll(Arrays.asList(VALUE_FILTER_PACKAGE));

    fastJsonConfig.setSerializeFilters(getDefineFilters(packages));

    fastConverter.setFastJsonConfig(fastJsonConfig);
    return new HttpMessageConverters(fastConverter);
}
 
Example #18
Source Project: api-boot   Author: minbox-projects   File: ApiBootMyBatisEnhanceAutoConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

    logger.debug("Searching for mappers based with EnhanceMapper.class");
    // 重写扫描实现类
    // 将扫描到的每一个类
    EnhanceClassPathMapperScanner scanner = new EnhanceClassPathMapperScanner(registry);
    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }

        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (logger.isDebugEnabled()) {
            for (String pkg : packages) {
                logger.debug("Using auto-configuration base package '{}'", pkg);
            }
        }
        // 通过标记的父接口扫描
        scanner.setMarkerInterface(EnhanceMapper.class);
        // 通过注解形式扫描
        //scanner.setAnnotationClass(Mapper.class);
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #19
Source Project: api-boot   Author: minbox-projects   File: ApiBootSwaggerAutoConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 配置swagger基本信息
 * - BasePackage
 * 默认使用SpringBoot项目扫描bean根目录
 * 如果存在配置时则使用SwaggerProperties.basePackage作为扫描根目录
 *
 * @return Docket实例
 */
@Bean
public Docket docket() {
    String basePackage = swaggerProperties.getBasePackage();
    if (StringUtils.isEmpty(basePackage)) {
        basePackage = AutoConfigurationPackages.get(beanFactory).get(0);
    }
    return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).securitySchemes(Collections.singletonList(apiKey())).securityContexts(Collections.singletonList(securityContext())).select().apis(RequestHandlerSelectors.basePackage(basePackage)).paths(PathSelectors.any()).build();
}
 
Example #20
Source Project: brpc-java   Author: baidu   File: RpcExporterRegister.java    License: Apache License 2.0 5 votes vote down vote up
private Collection<BeanDefinition> getCandidates(ResourceLoader resourceLoader) {
    ClassPathScanningCandidateComponentProvider scanner =
            new ClassPathScanningCandidateComponentProvider(false, environment);

    scanner.addIncludeFilter(new AnnotationTypeFilter(RpcExporter.class));
    scanner.setResourceLoader(resourceLoader);
    return AutoConfigurationPackages.get(beanFactory).stream()
            .flatMap(basePackage -> scanner.findCandidateComponents(basePackage).stream())
            .collect(Collectors.toSet());
}
 
Example #21
Source Project: spring-init   Author: spring-projects-experimental   File: FunctionalInstallerImportRegistrars.java    License: Apache License 2.0 5 votes vote down vote up
private Set<Imported> prioritize(Set<Imported> registrars) {
	Set<Imported> result = new LinkedHashSet<>();
	for (Imported imported : registrars) {
		if (imported.getType() != null
				&& imported.getType().getName().startsWith(AutoConfigurationPackages.class.getName())) {
			result.add(imported);
		}
	}
	result.addAll(registrars);
	return result;
}
 
Example #22
Source Project: mdw   Author: CenturyLinkCloud   File: AnnotationsScanner.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Source files under src/main/java are scanned for @Activity annotations.
 */
public void findSpringAnnotatedClasses() {
    List<String> scanPackages = AutoConfigurationPackages.get(beanFactory);
    ClassPathScanningCandidateComponentProvider provider = createScannerComponentProvider();
    for (String scanPackage : scanPackages) {
        for (BeanDefinition beanDef : provider.findCandidateComponents(scanPackage)) {
            beanDef.setScope(BeanDefinition.SCOPE_PROTOTYPE);
            addImplementor(beanDef);
        }
    }
}
 
Example #23
Source Project: wicket-spring-boot   Author: MarcGiffing   File: ClassCandidateScanner.java    License: Apache License 2.0 5 votes vote down vote up
private static Collection<String> getMappingBasePackages(BeanFactory beanFactory) {
	try {
		return AutoConfigurationPackages.get(beanFactory);
	}
	catch (IllegalStateException ex) {
		// no auto-configuration package registered yet
		return Collections.emptyList();
	}
}
 
Example #24
Source Project: Mapper   Author: abel533   File: MapperAutoConfiguration.java    License: MIT License 5 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

    logger.debug("Searching for mappers annotated with @Mapper");

    ClassPathMapperScanner scanner = new ClassPathMapperScanner(registry);
    scanner.setMapperProperties(environment);
    try {
        if (this.resourceLoader != null) {
            scanner.setResourceLoader(this.resourceLoader);
        }
        List<String> packages = AutoConfigurationPackages.get(this.beanFactory);
        if (logger.isDebugEnabled()) {
            for (String pkg : packages) {
                logger.debug("Using auto-configuration base package '{}'", pkg);
            }
        }
        BaseProperties properties = SpringBootBindUtil.bind(environment, BaseProperties.class, BaseProperties.MYBATIS_PREFIX);
        if(properties != null && properties.getBasePackages() != null && properties.getBasePackages().length > 0){
            packages.addAll(Arrays.asList(properties.getBasePackages()));
        } else {
            //设置了包名的情况下,不需要指定该注解
            scanner.setAnnotationClass(Mapper.class);
        }
        scanner.registerFilters();
        scanner.doScan(StringUtils.toStringArray(packages));
    } catch (IllegalStateException ex) {
        logger.debug("Could not determine auto-configuration package, automatic mapper scanning disabled.", ex);
    }
}
 
Example #25
Source Project: moduliths   Author: odrotbohm   File: ModuleBTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test // #4
void tweaksAutoConfigurationPackageToModulePackage() {

	assertThat(AutoConfigurationPackages.get(context)) //
			.containsExactly(getClass().getPackage().getName());
}
 
Example #26
Source Project: brpc-java   Author: baidu   File: AbstractRegister.java    License: Apache License 2.0 4 votes vote down vote up
protected Collection<String> getBasePackages() {
    return AutoConfigurationPackages.get(beanFactory);
}
 
Example #27
Source Project: spring-domain-events   Author: odrotbohm   File: DomainEventsAutoConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
	AutoConfigurationPackages.register(registry, EventPublication.class.getPackage().getName());
}
 
Example #28
Source Project: spring-content   Author: paulcwarren   File: MongoContentAutoConfigureRegistrar.java    License: Apache License 2.0 4 votes vote down vote up
protected String[] getBasePackages() {
	return AutoConfigurationPackages.get(this.getBeanFactory())
			.toArray(new String[] {});
}
 
Example #29
Source Project: spring-content   Author: paulcwarren   File: JpaContentAutoConfigureRegistrar.java    License: Apache License 2.0 4 votes vote down vote up
protected String[] getBasePackages() {
	return AutoConfigurationPackages.get(this.getBeanFactory())
			.toArray(new String[] {});
}
 
Example #30
Source Project: spring-content   Author: paulcwarren   File: FilesystemContentAutoConfigureRegistrar.java    License: Apache License 2.0 4 votes vote down vote up
protected String[] getBasePackages() {
	return AutoConfigurationPackages.get(this.getBeanFactory())
			.toArray(new String[] {});
}