當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。