本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
};
}
示例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);
}
示例11: getStrategy
import org.springframework.boot.autoconfigure.condition.SearchStrategy; //导入依赖的package包/类
public SearchStrategy getStrategy() {
return (this.strategy != null ? this.strategy : SearchStrategy.ALL);
}
示例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