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


Java ServletRegistrationBean.setAsyncSupported方法代码示例

本文整理汇总了Java中org.springframework.boot.web.servlet.ServletRegistrationBean.setAsyncSupported方法的典型用法代码示例。如果您正苦于以下问题:Java ServletRegistrationBean.setAsyncSupported方法的具体用法?Java ServletRegistrationBean.setAsyncSupported怎么用?Java ServletRegistrationBean.setAsyncSupported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.boot.web.servlet.ServletRegistrationBean的用法示例。


在下文中一共展示了ServletRegistrationBean.setAsyncSupported方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerProxyServlet

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
/**
 * Configures a custom jetty http proxy servlet based on <b>oneops.proxy.enabled</b>
 * config property. The proxy configuration is done on the <b>application.yaml</b> file.
 *
 * @param config OneOps config
 * @return {@link ServletRegistrationBean}
 */
@Bean
@ConditionalOnProperty("oneops.proxy.enabled")
public ServletRegistrationBean registerProxyServlet(OneOpsConfig config) {
    log.info("OneOps Http Proxy is enabled.");
    OneOpsConfig.Proxy proxyCfg = config.getProxy();

    Map<String, String> initParams = new HashMap<>();
    initParams.put(proxyTo.name(), proxyCfg.getProxyTo());
    initParams.put(prefix.name(), proxyCfg.getPrefix());
    initParams.put(viaHost.name(), proxyCfg.getViaHost());
    initParams.put(trustAll.name(), String.valueOf(proxyCfg.isTrustAll()));
    initParams.put(xAuthHeader.name(), config.getAuth().getHeader());

    ServletRegistrationBean servletBean = new ServletRegistrationBean(new ProxyServlet(), proxyCfg.getPrefix() + "/*");
    servletBean.setName("OneOps Proxy Servlet");
    servletBean.setInitParameters(initParams);
    servletBean.setAsyncSupported(true);
    log.info("Configured OneOps proxy servlet with mapping: " + proxyCfg.getPrefix());
    return servletBean;
}
 
开发者ID:oneops,项目名称:secrets-proxy,代码行数:28,代码来源:EmbeddedServerConfig.java

示例2: keycloakJaxRsApplication

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
ServletRegistrationBean keycloakJaxRsApplication(KeycloakServerProperties keycloakServerProperties, DataSource dataSource) throws Exception {

  mockJndiEnvironment(dataSource);

  //FIXME: hack to propagate Spring Boot Properties to Keycloak Application
  EmbeddedKeycloakApplication.keycloakServerProperties = keycloakServerProperties;

  ServletRegistrationBean servlet = new ServletRegistrationBean(new HttpServlet30Dispatcher());
  servlet.addInitParameter("javax.ws.rs.Application", EmbeddedKeycloakApplication.class.getName());
  servlet.addInitParameter(ResteasyContextParameters.RESTEASY_SERVLET_MAPPING_PREFIX, keycloakServerProperties.getContextPath());
  servlet.addInitParameter(ResteasyContextParameters.RESTEASY_USE_CONTAINER_FORM_PARAMS, "true");
  servlet.addUrlMappings(keycloakServerProperties.getContextPath() + "/*");
  servlet.setLoadOnStartup(1);
  servlet.setAsyncSupported(true);

  return servlet;
}
 
开发者ID:thomasdarimont,项目名称:spring-boot-keycloak-server-example,代码行数:19,代码来源:EmbeddedKeycloakConfig.java

示例3: routeServlet1

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
public ServletRegistrationBean routeServlet1(RouterFunction<?> routerFunction) throws Exception {
HttpHandler httpHandler = RouterFunctions.toHttpHandler(routerFunction );
ServletHttpHandlerAdapter servlet = new ServletHttpHandlerAdapter(httpHandler);

     ServletRegistrationBean registrationBean = new ServletRegistrationBean<>(servlet, "/flux" + "/*");
     registrationBean.setLoadOnStartup(1);
     registrationBean.setAsyncSupported(true);
     
 	System.out.println("starts server");		
     return registrationBean;
 }
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:12,代码来源:HttpServerConfig.java

示例4: cxfServlet

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean cxfServlet() {
    final ServletRegistrationBean bean = new ServletRegistrationBean();
    bean.setEnabled(true);
    bean.setName("cxfServletSecurityTokenService");
    bean.setServlet(new CXFServlet());
    bean.setUrlMappings(Collections.singleton(WSFederationConstants.ENDPOINT_STS.concat("*")));
    bean.setAsyncSupported(true);
    return bean;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:11,代码来源:CoreWsSecuritySecurityTokenServiceConfiguration.java

示例5: servletRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
ServletRegistrationBean servletRegistration(DruidStatProperties druidStatConfig) {
	ServletRegistrationBean filterRegistration = new ServletRegistrationBean(new StatViewServlet());
	filterRegistration.setAsyncSupported(true);
	filterRegistration.setEnabled(true);
	filterRegistration.addUrlMappings("/druid/*");
	filterRegistration.setInitParameters(druidStatParameters(druidStatConfig));
	return filterRegistration;
}
 
开发者ID:halober,项目名称:spring-boot-starter-dao,代码行数:10,代码来源:DruidWebStatAutoConfiguration.java

示例6: dispatcherRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletRegistrationBean dispatcherRegistration(DispatcherServlet dispatcherServlet){
    ServletRegistrationBean bean =
            new ServletRegistrationBean(dispatcherServlet, "/restapi/*");
    bean.setAsyncSupported(true);
    bean.setName("catgenome");
    bean.setLoadOnStartup(1);

    return bean;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:11,代码来源:AppMVCConfiguration.java

示例7: servletRegistrationBean

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
@Bean // for socket.io
public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean bean = new ServletRegistrationBean(new AtmosphereServlet(), "/coding-ide-tty1/*");

    bean.addInitParameter("socketio-transport", "websocket");
    bean.addInitParameter("socketio-timeout", "25000");
    bean.addInitParameter("socketio-heartbeat", "15000");
    bean.addInitParameter("socketio-suspendTime", "30000");
    bean.addInitParameter("org.atmosphere.cpr.sessionSupport", "true");
    bean.addInitParameter("SPACE_HOME", spaceHome);
    bean.setLoadOnStartup(100);
    bean.setAsyncSupported(true);

    return bean;
}
 
开发者ID:Coding,项目名称:WebIDE-Backend,代码行数:16,代码来源:WebSocketConfig.java

示例8: dispatcherServletRegistration

import org.springframework.boot.web.servlet.ServletRegistrationBean; //导入方法依赖的package包/类
/**
 * Register dispatcherServlet programmatically
 *
 * @return ServletRegistrationBean
 */
@Bean
public ServletRegistrationBean dispatcherServletRegistration() {

	ServletRegistrationBean registration = new ServletRegistrationBean(
		dispatcherServlet(), "/");

	registration
		.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
	registration.setAsyncSupported(true);
	registration.setEnabled(true);
	registration.setLoadOnStartup(1);

	return registration;
}
 
开发者ID:AppDirect,项目名称:service-integration-sdk,代码行数:20,代码来源:AsyncServletConfiguration.java


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