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