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


Java SearchStrategy类代码示例

本文整理汇总了Java中org.springframework.boot.autoconfigure.condition.SearchStrategy的典型用法代码示例。如果您正苦于以下问题:Java SearchStrategy类的具体用法?Java SearchStrategy怎么用?Java SearchStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SearchStrategy类属于org.springframework.boot.autoconfigure.condition包,在下文中一共展示了SearchStrategy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BeanSearchSpec

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
BeanSearchSpec(ConditionContext context, AnnotatedTypeMetadata metadata, Class<?> annotationType) {
    this.annotationType = annotationType;
    MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(annotationType.getName(), true);
    collect(attributes, "name", this.names);
    collect(attributes, "value", this.types);
    collect(attributes, "type", this.types);
    collect(attributes, "annotation", this.annotations);
    collect(attributes, "ignored", this.ignoredTypes);
    collect(attributes, "ignoredType", this.ignoredTypes);
    this.strategy = (SearchStrategy) metadata.getAnnotationAttributes(annotationType.getName()).get("search");
    BeanTypeDeductionException deductionException = null;
    try {
        if (this.types.isEmpty() && this.names.isEmpty()) {
            addDeducedBeanType(context, metadata, this.types);
        }
    } catch (BeanTypeDeductionException ex) {
        deductionException = ex;
    }
    validate(deductionException);
}
 
开发者ID:drtrang,项目名称:spring-boot-autoconfigure,代码行数:21,代码来源:OnBeansCondition.java

示例2: integrationManagementConfigurer

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean(name = IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME)
@ConditionalOnMissingBean(value = IntegrationManagementConfigurer.class, name = IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME, search = SearchStrategy.CURRENT)
public IntegrationManagementConfigurer integrationManagementConfigurer() {
    IntegrationManagementConfigurer configurer = new IntegrationManagementConfigurer();
    configurer.setDefaultCountsEnabled(true);
    configurer.setDefaultStatsEnabled(true);
    return configurer;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:9,代码来源:MetricsAutoConfiguration.java

示例3: mbeanExporter

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@Primary
@ConditionalOnMissingBean(value = MBeanExporter.class, search = SearchStrategy.CURRENT)
public AnnotationMBeanExporter mbeanExporter(ObjectNamingStrategy namingStrategy) {
	AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
	exporter.setRegistrationPolicy(RegistrationPolicy.FAIL_ON_EXISTING);
	exporter.setNamingStrategy(namingStrategy);
	String server = this.propertyResolver.getProperty("server", "mbeanServer");
	if (StringUtils.hasLength(server)) {
		exporter.setServer(this.beanFactory.getBean(server, MBeanServer.class));
	}
	return exporter;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:JmxAutoConfiguration.java

示例4: objectNamingStrategy

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(value = ObjectNamingStrategy.class, search = SearchStrategy.CURRENT)
public ParentAwareNamingStrategy objectNamingStrategy() {
	ParentAwareNamingStrategy namingStrategy = new ParentAwareNamingStrategy(
			new AnnotationJmxAttributeSource());
	String defaultDomain = this.propertyResolver.getProperty("default-domain");
	if (StringUtils.hasLength(defaultDomain)) {
		namingStrategy.setDefaultDomain(defaultDomain);
	}
	return namingStrategy;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:JmxAutoConfiguration.java

示例5: configurationPropertiesBeans

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
public ConfigurationPropertiesBeans configurationPropertiesBeans() {
	// Since this is a BeanPostProcessor we have to be super careful not to
	// cause a cascade of bean instantiation. Knowing the *name* of the beans we
	// need is super optimal, but a little brittle (unfortunately we have no
	// choice).
	ConfigurationBeanFactoryMetaData metaData = this.context.getBean(
			ConfigurationPropertiesBindingPostProcessorRegistrar.BINDER_BEAN_NAME
					+ ".store",
			ConfigurationBeanFactoryMetaData.class);
	ConfigurationPropertiesBeans beans = new ConfigurationPropertiesBeans();
	beans.setBeanMetaDataStore(metaData);
	return beans;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-commons,代码行数:16,代码来源:ConfigurationPropertiesRebinderAutoConfiguration.java

示例6: configurationPropertiesRebinder

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
public ConfigurationPropertiesRebinder configurationPropertiesRebinder(
		ConfigurationPropertiesBeans beans) {
	ConfigurationPropertiesRebinder rebinder = new ConfigurationPropertiesRebinder(
			beans);
	return rebinder;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-commons,代码行数:9,代码来源:ConfigurationPropertiesRebinderAutoConfiguration.java

示例7: eurekaClientConfigBean

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(value = EurekaClientConfig.class, search = SearchStrategy.CURRENT)
public EurekaClientConfigBean eurekaClientConfigBean() {
	EurekaClientConfigBean client = new EurekaClientConfigBean();
	if ("bootstrap".equals(this.env.getProperty("spring.config.name"))) {
		// We don't register during bootstrap by default, but there will be another
		// chance later.
		client.setRegisterWithEureka(false);
	}
	return client;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:12,代码来源:EurekaClientAutoConfiguration.java

示例8: eurekaApplicationInfoManager

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(value = ApplicationInfoManager.class, search = SearchStrategy.CURRENT)
public ApplicationInfoManager eurekaApplicationInfoManager(
		EurekaInstanceConfig config) {
	InstanceInfo instanceInfo = new InstanceInfoFactory().create(config);
	return new ApplicationInfoManager(config, instanceInfo);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:8,代码来源:EurekaClientAutoConfiguration.java

示例9: eurekaClient

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingBean(value = EurekaClient.class, search = SearchStrategy.CURRENT)
public EurekaClient eurekaClient(ApplicationInfoManager manager, EurekaClientConfig config, ApplicationContext context) {
	return new CloudEurekaClient(manager, config, null, context) {
		@Override
		public synchronized void shutdown() {
			CountDownLatch latch = countDownLatch();
			if (latch.getCount() == 1) {
				latch.countDown();
			}
			super.shutdown();
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:15,代码来源:EurekaClientAutoConfigurationTests.java

示例10: jsonapiErrorController

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT)
public BasicErrorController jsonapiErrorController(ErrorAttributes errorAttributes) {
	return new CrnkErrorController(errorAttributes, this.serverProperties.getError(), this.errorViewResolvers);
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:6,代码来源:CrnkErrorControllerAutoConfiguration.java

示例11: getStrategy

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
public SearchStrategy getStrategy() {
    return (this.strategy != null ? this.strategy : SearchStrategy.ALL);
}
 
开发者ID:drtrang,项目名称:spring-boot-autoconfigure,代码行数:4,代码来源:OnBeansCondition.java

示例12: autoConfigurationReportEndpoint

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnBean(ConditionEvaluationReport.class)
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
public AutoConfigurationReportEndpoint autoConfigurationReportEndpoint() {
	return new AutoConfigurationReportEndpoint();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:EndpointAutoConfiguration.java

示例13: errorAttributes

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT)
public DefaultErrorAttributes errorAttributes() {
	return new DefaultErrorAttributes();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:ErrorMvcAutoConfiguration.java

示例14: basicErrorController

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(value = ErrorController.class, search = SearchStrategy.CURRENT)
public BasicErrorController basicErrorController(ErrorAttributes errorAttributes) {
	return new BasicErrorController(errorAttributes, this.serverProperties.getError(),
			this.errorViewResolvers);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:ErrorMvcAutoConfiguration.java

示例15: serverProperties

import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
public ServerProperties serverProperties() {
	return new ServerProperties();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:ServerPropertiesAutoConfiguration.java


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