本文整理了Java中org.apache.catalina.startup.Tomcat.setConnector()
方法的一些代码示例,展示了Tomcat.setConnector()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tomcat.setConnector()
方法的具体详情如下:
包路径:org.apache.catalina.startup.Tomcat
类名称:Tomcat
方法名:setConnector
[英]Set the specified connector in the service, if it is not already present.
[中]在服务中设置指定的连接器(如果尚未存在)。
代码示例来源:origin: OryxProject/oryx
private void configureTomcat(Tomcat tomcat, Connector connector) {
tomcat.setBaseDir(noSuchBaseDir.toAbsolutePath().toString());
tomcat.setConnector(connector);
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public void setup() {
Connector connector = new Connector(Http11NioProtocol.class.getName());
connector.setPort(0);
File baseDir = createTempDir("tomcat");
String baseDirPath = baseDir.getAbsolutePath();
this.tomcatServer = new Tomcat();
this.tomcatServer.setBaseDir(baseDirPath);
this.tomcatServer.setPort(0);
this.tomcatServer.getService().addConnector(connector);
this.tomcatServer.setConnector(connector);
}
代码示例来源:origin: org.springframework.boot/spring-boot
@Override
public WebServer getWebServer(HttpHandler httpHandler) {
Tomcat tomcat = new Tomcat();
File baseDir = (this.baseDirectory != null) ? this.baseDirectory
: createTempDir("tomcat");
tomcat.setBaseDir(baseDir.getAbsolutePath());
Connector connector = new Connector(this.protocol);
tomcat.getService().addConnector(connector);
customizeConnector(connector);
tomcat.setConnector(connector);
tomcat.getHost().setAutoDeploy(false);
configureEngine(tomcat.getEngine());
TomcatHttpHandlerAdapter servlet = new TomcatHttpHandlerAdapter(httpHandler);
prepareContext(tomcat.getHost(), servlet);
return new TomcatWebServer(tomcat, getPort() >= 0);
}
代码示例来源:origin: org.springframework.boot/spring-boot
@Override
public WebServer getWebServer(ServletContextInitializer... initializers) {
Tomcat tomcat = new Tomcat();
File baseDir = (this.baseDirectory != null) ? this.baseDirectory
: createTempDir("tomcat");
tomcat.setBaseDir(baseDir.getAbsolutePath());
Connector connector = new Connector(this.protocol);
tomcat.getService().addConnector(connector);
customizeConnector(connector);
tomcat.setConnector(connector);
tomcat.getHost().setAutoDeploy(false);
configureEngine(tomcat.getEngine());
for (Connector additionalConnector : this.additionalTomcatConnectors) {
tomcat.getService().addConnector(additionalConnector);
}
prepareContext(tomcat.getHost(), initializers);
return getTomcatWebServer(tomcat);
}
代码示例来源:origin: org.apache.airavata/airavata-embedded-tomcat
public BetterTomcat() {
// Override the default Tomcat connector. Otherwise a Connector on 8080 will be started
tomcat.setConnector(new Connector(Protocol.HTTP_11.getProtocolName()));
// setDefaultHost("defaultHost");
// setBaseDir(".");
}
代码示例来源:origin: myrrix/myrrix-recommender
private void configureTomcat(Tomcat tomcat, Connector connector) {
tomcat.setBaseDir(noSuchBaseDir.getAbsolutePath());
tomcat.setConnector(connector);
tomcat.getService().addConnector(connector);
}
代码示例来源:origin: jsimone/webapp-runner
tomcat.setConnector(nioConnector);
代码示例来源:origin: com.github.jsimone/webapp-runner-main
tomcat.setConnector(nioConnector);
代码示例来源:origin: org.apache.tomcat.maven/tomcat7-war-runner
tomcat.setConnector( connector );
tomcat.setConnector( httpsConnector );
代码示例来源:origin: apache/tomcat-maven-plugin
tomcat.setConnector( connector );
tomcat.setConnector( httpsConnector );
代码示例来源:origin: apache/tomcat-maven-plugin
tomcat.setConnector( connector );
tomcat.setConnector( httpsConnector );
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
connector.setPort(port());
server.setConnector(connector);
server.getService().addConnector(connector);
代码示例来源:origin: apache/tomcat-maven-plugin
embeddedTomcat.setConnector( connector );
代码示例来源:origin: apache/tomcat-maven-plugin
embeddedTomcat.setConnector( connector );
代码示例来源:origin: nutzam/nutzboot
@Override
public void init() throws LifecycleException {
this.tomcat = new Tomcat();
File baseDir = createTempDir("tomcat");
this.tomcat.setBaseDir(baseDir.getAbsolutePath());
Connector connector = new Connector(PROP_PROTOCOL);
connector.setPort(getPort());
connector.setURIEncoding(DEFAULT_CHARSET.name());
connector.setMaxPostSize(conf.getInt(PROP_MAX_POST_SIZE, 64 * 1024 * 1024));
String connectorKey = PRE + "connector.";
for (String key : conf.keys()) {
if (key.startsWith(connectorKey)) {
String k = key.substring(connectorKey.length());
String v = conf.get(key);
connector.setProperty(k, v);
}
}
// 设置一下最大线程数
this.tomcat.getService().addConnector(connector);
StandardThreadExecutor executor = new StandardThreadExecutor();
executor.setMaxThreads(getMaxThread());
connector.getService().addExecutor(executor);
this.tomcat.setConnector(connector);
this.tomcat.setHostname(getHost());
this.tomcat.getHost().setAutoDeploy(false);
this.tomcat.getEngine().setBackgroundProcessorDelay(30);
this.prepareContext();
}
代码示例来源:origin: ch.rasc/embeddedtc
connector.setURIEncoding("UTF-8");
connector.setMaxPostSize(this.maxPostSize);
this.tomcat.setConnector(connector);
this.tomcat.getService().addConnector(connector);
代码示例来源:origin: com.att.nsa/nsaServerLibrary
tomcat.setConnector ( conn );
内容来源于网络,如有侵权,请联系作者删除!