|
|
|
@ -58,29 +58,35 @@ public final class TomcatCustomizer { |
|
|
|
customizeRemoteIpValve(serverProperties, environment, factory); |
|
|
|
customizeRemoteIpValve(serverProperties, environment, factory); |
|
|
|
propertyMapper.from(tomcatProperties::getMaxThreads) |
|
|
|
propertyMapper.from(tomcatProperties::getMaxThreads) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.to(maxThreads -> customizeMaxThreads(factory, tomcatProperties.getMaxThreads())); |
|
|
|
.to((maxThreads) -> customizeMaxThreads(factory, |
|
|
|
|
|
|
|
tomcatProperties.getMaxThreads())); |
|
|
|
propertyMapper.from(tomcatProperties::getMinSpareThreads) |
|
|
|
propertyMapper.from(tomcatProperties::getMinSpareThreads) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.to(minSpareThreads -> customizeMinThreads(factory, minSpareThreads)); |
|
|
|
.to((minSpareThreads) -> customizeMinThreads(factory, minSpareThreads)); |
|
|
|
propertyMapper.from(() -> determineMaxHttpHeaderSize(serverProperties, tomcatProperties)) |
|
|
|
propertyMapper |
|
|
|
|
|
|
|
.from(() -> determineMaxHttpHeaderSize(serverProperties, |
|
|
|
|
|
|
|
tomcatProperties)) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.to(maxHttpHeaderSize -> customizeMaxHttpHeaderSize(factory, maxHttpHeaderSize)); |
|
|
|
.to((maxHttpHeaderSize) -> customizeMaxHttpHeaderSize(factory, |
|
|
|
|
|
|
|
maxHttpHeaderSize)); |
|
|
|
propertyMapper.from(tomcatProperties::getMaxHttpPostSize) |
|
|
|
propertyMapper.from(tomcatProperties::getMaxHttpPostSize) |
|
|
|
.when(maxHttpPostSize -> maxHttpPostSize != 0) |
|
|
|
.when((maxHttpPostSize) -> maxHttpPostSize != 0) |
|
|
|
.to(maxHttpPostSize -> customizeMaxHttpPostSize(factory, maxHttpPostSize)); |
|
|
|
.to((maxHttpPostSize) -> customizeMaxHttpPostSize(factory, |
|
|
|
|
|
|
|
maxHttpPostSize)); |
|
|
|
propertyMapper.from(tomcatProperties::getAccesslog) |
|
|
|
propertyMapper.from(tomcatProperties::getAccesslog) |
|
|
|
.when(ServerProperties.Tomcat.Accesslog::isEnabled) |
|
|
|
.when(ServerProperties.Tomcat.Accesslog::isEnabled) |
|
|
|
.to(enabled -> customizeAccessLog(tomcatProperties, factory)); |
|
|
|
.to((enabled) -> customizeAccessLog(tomcatProperties, factory)); |
|
|
|
propertyMapper.from(tomcatProperties::getUriEncoding).whenNonNull() |
|
|
|
propertyMapper.from(tomcatProperties::getUriEncoding).whenNonNull() |
|
|
|
.to(factory::setUriEncoding); |
|
|
|
.to(factory::setUriEncoding); |
|
|
|
propertyMapper.from(serverProperties::getConnectionTimeout).whenNonNull() |
|
|
|
propertyMapper.from(serverProperties::getConnectionTimeout).whenNonNull() |
|
|
|
.to(connectionTimeout -> customizeConnectionTimeout(factory, connectionTimeout)); |
|
|
|
.to((connectionTimeout) -> customizeConnectionTimeout(factory, |
|
|
|
|
|
|
|
connectionTimeout)); |
|
|
|
propertyMapper.from(tomcatProperties::getMaxConnections) |
|
|
|
propertyMapper.from(tomcatProperties::getMaxConnections) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.to(maxConnections -> customizeMaxConnections(factory, maxConnections)); |
|
|
|
.to((maxConnections) -> customizeMaxConnections(factory, maxConnections)); |
|
|
|
propertyMapper.from(tomcatProperties::getAcceptCount) |
|
|
|
propertyMapper.from(tomcatProperties::getAcceptCount) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.when(TomcatCustomizer::isPositive) |
|
|
|
.to(acceptCount -> customizeAcceptCount(factory, acceptCount)); |
|
|
|
.to((acceptCount) -> customizeAcceptCount(factory, acceptCount)); |
|
|
|
customizeStaticResources(serverProperties.getTomcat().getResource(), factory); |
|
|
|
customizeStaticResources(serverProperties.getTomcat().getResource(), factory); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -234,4 +240,5 @@ public final class TomcatCustomizer { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|