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


Java ConditionalOnWebApplication类代码示例

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


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

示例1: wingtipsRequestTracingFilter

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
/**
 * Create and return a {@link RequestTracingFilter}, which will auto-register itself with the Spring Boot app as
 * a servlet filter and enable Wingtips tracing for incoming requests.
 *
 * @return The {@link RequestTracingFilter} that should be used.
 */
@Bean
@ConditionalOnWebApplication
public FilterRegistrationBean wingtipsRequestTracingFilter() {
    if (wingtipsProperties.isWingtipsDisabled()) {
        // We can't return null or create a FilterRegistrationBean that has a null filter inside as it will result
        //      in a NullPointerException. So instead we'll return a do-nothing servlet filter.
        return new FilterRegistrationBean(new DoNothingServletFilter());
    }

    // Allow projects to completely override the filter that gets used if desired. If not overridden then create
    //      a new one.
    if (requestTracingFilter == null) {
        requestTracingFilter = new RequestTracingFilter();
    }
    
    FilterRegistrationBean frb = new FilterRegistrationBean(requestTracingFilter);
    // Add the user ID header keys init param if specified in the wingtips properties.
    if (wingtipsProperties.getUserIdHeaderKeys() != null) {
        frb.addInitParameter(RequestTracingFilter.USER_ID_HEADER_KEYS_LIST_INIT_PARAM_NAME,
                             wingtipsProperties.getUserIdHeaderKeys());
    }
    // Set the order so that the tracing filter is registered first
    frb.setOrder(Ordered.HIGHEST_PRECEDENCE);
    return frb;
}
 
开发者ID:Nike-Inc,项目名称:wingtips,代码行数:32,代码来源:WingtipsSpringBootConfiguration.java

示例2: tracerFilter

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean
@ConditionalOnWebApplication
@ConditionalOnProperty(name = "tracer.filter.enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnMissingBean(name = FILTER_NAME)
public FilterRegistrationBean tracerFilter(final Tracer tracer) {
    final Filter filter = new TracerFilter(tracer);
    final FilterRegistrationBean registration = new FilterRegistrationBean(filter);
    registration.setName(FILTER_NAME);
    registration.setDispatcherTypes(REQUEST, ASYNC);
    registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
    return registration;
}
 
开发者ID:zalando,项目名称:tracer,代码行数:13,代码来源:TracerAutoConfiguration.java

示例3: noOpLastOperatorWrapper

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean
@ConditionalOnWebApplication
LastOperatorWrapper noOpLastOperatorWrapper() {
	return new LastOperatorWrapper() {
		@Override public void wrapLastOperator(Tracer tracer) {
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:9,代码来源:TraceReactorAutoConfiguration.java

示例4: triggerRestController

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean(name = "triggerRestController")
@ConditionalOnWebApplication
public MvcEndpoint triggerRestController(@Qualifier("schedulingService") SchedulingService schedulingService) {
    return new SchedulingServiceRestController(schedulingService);
}
 
开发者ID:taboola,项目名称:taboola-cronyx,代码行数:6,代码来源:CronyxAutoConfiguration.java

示例5: jobRestController

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean(name = "jobRestController")
@ConditionalOnWebApplication
public MvcEndpoint jobRestController(@Qualifier("defaultJobsService") JobsService jobSchedulingService) {
    return new JobServiceRestController(jobSchedulingService);
}
 
开发者ID:taboola,项目名称:taboola-cronyx,代码行数:6,代码来源:CronyxAutoConfiguration.java

示例6: serverProperties

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

示例7: lineBotServerArgumentProcessor

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean
@ConditionalOnWebApplication
public LineBotServerArgumentProcessor lineBotServerArgumentProcessor() {
    return new LineBotServerArgumentProcessor();
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:6,代码来源:LineBotAutoConfiguration.java

示例8: lineBotServerInterceptor

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean
@ConditionalOnWebApplication
public LineBotServerInterceptor lineBotServerInterceptor() {
    return new LineBotServerInterceptor();
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:6,代码来源:LineBotAutoConfiguration.java

示例9: lineSignatureValidator

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean
@ConditionalOnWebApplication
public LineSignatureValidator lineSignatureValidator() {
    return new LineSignatureValidator(
            lineBotProperties.getChannelSecret().getBytes(StandardCharsets.US_ASCII));
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:7,代码来源:LineBotAutoConfiguration.java

示例10: lineBotCallbackRequestParser

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; //导入依赖的package包/类
@Bean
@ConditionalOnWebApplication
public LineBotCallbackRequestParser lineBotCallbackRequestParser(
        LineSignatureValidator lineSignatureValidator) {
    return new LineBotCallbackRequestParser(lineSignatureValidator);
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:7,代码来源:LineBotAutoConfiguration.java


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