- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.springframework.boot.web.context.WebServerApplicationContext.getWebServer()
方法的一些代码示例,展示了WebServerApplicationContext.getWebServer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebServerApplicationContext.getWebServer()
方法的具体详情如下:
包路径:org.springframework.boot.web.context.WebServerApplicationContext
类名称:WebServerApplicationContext
方法名:getWebServer
[英]Returns the WebServer that was created by the context or null if the server has not yet been created.
[中]返回由上下文创建的Web服务器,如果服务器尚未创建,则返回null。
代码示例来源:origin: line/armeria
@Test
public void verifySingleConnector() {
// Relevant to Tomcat 9.0
assertThat(applicationContext).isInstanceOf(WebServerApplicationContext.class);
WebServer webServer = ((WebServerApplicationContext) applicationContext).getWebServer();
assertThat(webServer).isInstanceOf(TomcatWebServer.class);
assertThat(((TomcatWebServer) webServer).getTomcat()
.getEngine()
.getService()
.findConnectors()).hasSize(1);
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator
private ThreadPool findThreadPool(ApplicationContext applicationContext) {
if (applicationContext instanceof WebServerApplicationContext) {
WebServer webServer = ((WebServerApplicationContext) applicationContext)
.getWebServer();
if (webServer instanceof JettyWebServer) {
return ((JettyWebServer) webServer).getServer().getThreadPool();
}
}
return null;
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator
private Manager findManager(ApplicationContext applicationContext) {
if (applicationContext instanceof WebServerApplicationContext) {
WebServer webServer = ((WebServerApplicationContext) applicationContext)
.getWebServer();
if (webServer instanceof TomcatWebServer) {
Context context = findContext((TomcatWebServer) webServer);
return context.getManager();
}
}
return null;
}
代码示例来源:origin: org.springframework.boot/spring-boot-actuator-autoconfigure
@Override
public void afterSingletonsInstantiated() {
if (this.applicationContext instanceof WebServerApplicationContext
&& ((WebServerApplicationContext) this.applicationContext)
.getWebServer() != null) {
ConfigurableWebServerApplicationContext managementContext = this.managementContextFactory
.createManagementContext(this.applicationContext,
EnableChildManagementContextConfiguration.class,
PropertyPlaceholderAutoConfiguration.class);
managementContext.setServerNamespace("management");
managementContext.setId(this.applicationContext.getId() + ":management");
setClassLoaderIfPossible(managementContext);
CloseManagementContextListener.addIfPossible(this.applicationContext,
managementContext);
managementContext.refresh();
}
else {
logger.warn("Could not start embedded management container on "
+ "different port (management endpoints are still available "
+ "through JMX)");
}
}
本文整理了Java中org.springframework.boot.web.context.WebServerApplicationContext.getServerNamespace()方法的一些
本文整理了Java中org.springframework.boot.web.context.WebServerApplicationContext.getWebServer()方法的一些代码示例,展
我是一名优秀的程序员,十分优秀!