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


Java TomcatEmbeddedServletContainerFactory.addAdditionalTomcatConnectors方法代码示例

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


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

示例1: configureHttp

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
private void configureHttp(final TomcatEmbeddedServletContainerFactory tomcat) {
    final CasServerProperties.Http http = casProperties.getServer().getHttp();
    if (http.isEnabled()) {
        LOGGER.debug("Creating HTTP configuration for the embedded tomcat container...");
        final Connector connector = new Connector(http.getProtocol());
        int port = http.getPort();
        if (port <= 0) {
            LOGGER.warn("No explicit port configuration is provided to CAS. Scanning for available ports...");
            port = SocketUtils.findAvailableTcpPort();
        }
        LOGGER.info("Activated embedded tomcat container HTTP port to [{}]", port);
        connector.setPort(port);

        LOGGER.debug("Configuring embedded tomcat container for HTTP2 protocol support");
        connector.addUpgradeProtocol(new Http2Protocol());

        http.getAttributes().forEach(connector::setAttribute);
        tomcat.addAdditionalTomcatConnectors(connector);
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:21,代码来源:CasEmbeddedContainerTomcatConfiguration.java

示例2: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };

    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
 
开发者ID:sfahadahmed,项目名称:hungrydragon,代码行数:18,代码来源:TomcatConfig.java

示例3: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {

    final TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
    if (isEnabled()) {
        final Connector ajpConnector = new Connector(getProtocol());
        ajpConnector.setPort(getPort());
        ajpConnector.setSecure(isSecure());
        ajpConnector.setAllowTrace(isAllowTrace());
        ajpConnector.setScheme(getScheme());

        tomcat.addAdditionalTomcatConnectors(ajpConnector);
    }

    return tomcat;
}
 
开发者ID:redlink-gmbh,项目名称:smarti,代码行数:17,代码来源:TomcatConfiguration.java

示例4: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer(SslProperties properties) {
	TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
		@Override
		protected void postProcessContext(Context context) {
			SecurityConstraint securityConstraint = new SecurityConstraint();
			securityConstraint.setUserConstraint("CONFIDENTIAL");
			SecurityCollection collection = new SecurityCollection();
			collection.addPattern("/*");
			securityConstraint.addCollection(collection);
			context.addConstraint(securityConstraint);
		}
	};
	tomcat.addAdditionalTomcatConnectors(createSslConnector(properties));
	return tomcat;
}
 
开发者ID:Saisimon,项目名称:tip,代码行数:17,代码来源:TomcatWebConfig.java

示例5: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    final TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory();
    // tomcatFactory.setAddress(InetAddress.getLocalHost());// you can restrict localhost access
    tomcatFactory.setPort(8080);
    // ServletContainerInitializer

    final Connector connector = new Connector();
    connector.setPort(8443);
    connector.setSecure(true);
    connector.setScheme("https");
    connector.setProperty("SSLEnabled", "true");
    connector.setProperty("keystorePass", "spring");
    try {
        final ClassPathResource classPathResource = new ClassPathResource("keystore");
        System.err.println(classPathResource.getFile().getAbsolutePath());
        connector.setProperty("keystoreFile", classPathResource.getFile().getAbsolutePath());
    } catch (final Exception e) {
        System.err.println("Error while loading classpath resource " + e.getMessage());
    }

    tomcatFactory.addAdditionalTomcatConnectors(connector);
    return tomcatFactory;
}
 
开发者ID:tvajjala,项目名称:interview-preparation,代码行数:25,代码来源:DispatchServletConfig.java

示例6: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
/**
 * <p>servletContainer.</p>
 *
 * @return a {@link org.springframework.boot.context.embedded.EmbeddedServletContainerFactory} object.
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
	TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
		@Override
		protected void postProcessContext(Context context) {
			SecurityConstraint securityConstraint = new SecurityConstraint();
			securityConstraint.setUserConstraint("CONFIDENTIAL");
			SecurityCollection collection = new SecurityCollection();
			collection.addPattern("/*");
			securityConstraint.addCollection(collection);
			context.addConstraint(securityConstraint);
		}
	};

	tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
	return tomcat;
}
 
开发者ID:rajadilipkolli,项目名称:springsecuredthymeleafapp,代码行数:23,代码来源:WebConfiguration.java

示例7: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };
    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
 
开发者ID:bhits,项目名称:edge-server,代码行数:17,代码来源:WebConfig.java

示例8: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
public EmbeddedServletContainerFactory servletContainer() {
	TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
		@Override
		protected void postProcessContext(Context context) {
			SecurityConstraint constraint = new SecurityConstraint();
			constraint.setUserConstraint("CONFIDENTIAL");
			SecurityCollection collection = new SecurityCollection();
			collection.addPattern("/*");
			constraint.addCollection(collection);
			context.addConstraint(constraint);
		}
	};
	tomcat.addAdditionalTomcatConnectors(httpConnector());
	return tomcat;
}
 
开发者ID:514840279,项目名称:danyuan-application,代码行数:16,代码来源:App.java

示例9: configureAjp

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
private void configureAjp(final TomcatEmbeddedServletContainerFactory tomcat) {
    final CasServerProperties.Ajp ajp = casProperties.getServer().getAjp();
    if (ajp.isEnabled() && ajp.getPort() > 0) {
        LOGGER.debug("Creating AJP configuration for the embedded tomcat container...");
        final Connector ajpConnector = new Connector(ajp.getProtocol());
        ajpConnector.setProtocol(ajp.getProtocol());
        ajpConnector.setPort(ajp.getPort());
        ajpConnector.setSecure(ajp.isSecure());
        ajpConnector.setAllowTrace(ajp.isAllowTrace());
        ajpConnector.setScheme(ajp.getScheme());
        if (ajp.getAsyncTimeout() > 0) {
            ajpConnector.setAsyncTimeout(ajp.getAsyncTimeout());
        }
        ajpConnector.setEnableLookups(ajp.isEnableLookups());
        if (ajp.getMaxPostSize() > 0) {
            ajpConnector.setMaxPostSize(ajp.getMaxPostSize());
        }
        ajpConnector.addUpgradeProtocol(new Http2Protocol());

        if (ajp.getProxyPort() > 0) {
            LOGGER.debug("Set AJP proxy port to [{}]", ajp.getProxyPort());
            ajpConnector.setProxyPort(ajp.getProxyPort());
        }

        if (ajp.getRedirectPort() > 0) {
            LOGGER.debug("Set AJP redirect port to [{}]", ajp.getRedirectPort());
            ajpConnector.setRedirectPort(ajp.getRedirectPort());
        }

        ajp.getAttributes().forEach(ajpConnector::setAttribute);

        tomcat.addAdditionalTomcatConnectors(ajpConnector);
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:35,代码来源:CasEmbeddedContainerTomcatConfiguration.java

示例10: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {

  TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
  Connector[] additionalConnectors = this.additionalConnector();
  if (additionalConnectors != null && additionalConnectors.length > 0) {
    tomcat.addAdditionalTomcatConnectors(additionalConnectors);
  }

 return tomcat;
}
 
开发者ID:SeldonIO,项目名称:seldon-core,代码行数:12,代码来源:TomcatConfig.java

示例11: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
/**
 * @return servletContainer bean reconfigured using SSL
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
  final TomcatEmbeddedServletContainerFactory tomcat =
      new TomcatEmbeddedServletContainerFactory();
  tomcat.addAdditionalTomcatConnectors(createHttpConnector());
  return tomcat;
}
 
开发者ID:adobe,项目名称:S3Mock,代码行数:11,代码来源:S3MockApplication.java

示例12: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {

	TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
	if (tomcatAjpEnabled) {
		Connector ajpConnector = new Connector("AJP/1.3");
		ajpConnector.setPort(ajpPort);
		ajpConnector.setSecure(false);
		ajpConnector.setAllowTrace(false);
		ajpConnector.setScheme("http");
		tomcat.addAdditionalTomcatConnectors(ajpConnector);
	}

	return tomcat;
}
 
开发者ID:allianzit,项目名称:ait-platform,代码行数:16,代码来源:AitTomcatCustomizer.java

示例13: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
/**
 * adds SSL connector to Tomcat
 *
 * @return
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
    if (StringUtils.hasText(keystoreFile)) {
        tomcat.addAdditionalTomcatConnectors(createSslConnector());
    }
    return tomcat;
}
 
开发者ID:codeabovelab,项目名称:haven-platform,代码行数:14,代码来源:ServletContainerConfiguration.java

示例14: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
    tomcat.addAdditionalTomcatConnectors(createStandardConnector());
    return tomcat;
}
 
开发者ID:easyframe,项目名称:easyframe,代码行数:7,代码来源:ZuulHttpConnector.java

示例15: servletContainer

import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@Bean
public EmbeddedServletContainerFactory servletContainer() {
	TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
	tomcat.addAdditionalTomcatConnectors(createStandardConnector());
	return tomcat;
}
 
开发者ID:actility,项目名称:generic-http-listener,代码行数:7,代码来源:ServerRunner.java


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