-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Provide a callback for customising Tomcat's ProtocolHandler #16342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can you elaborate on that? |
Once the TomcatServletWebServerFactory factory = getFactory();
factory.addProtocolHandlerCustomizers(
(TomcatProtocolHandlerCustomizer) protocolHandler -> protocolHandler.setThreadPriority(23));
Tomcat tomcat = getTomcat(factory);
Connector connector = ((TomcatWebServer) this.webServer).getServiceConnectors()
.get(tomcat.getService())[0];
AbstractProtocol protocolHandler = (AbstractProtocol) connector.getProtocolHandler();
assertThat(protocolHandler.getThreadPriority()).isEqualTo(23); |
@mbhave Ok, that makes sense. I missed that, sorry! So should i call
Would be the I tried it this way and confirmed it with the test. I just want to clarify that i am on the right track. |
@pas2al Yup, void customize(ProtocolHandler protocolHandler); |
Ok, thanks for the feedback! Regarding the
So passing the type to the |
Sorry, you're right. I meant we could change the generic to expect a public interface TomcatProtocolHandlerCustomizer<T extends ProtocolHandler> { That way we don't need to cast it to an |
Ok, should i type usages of the |
I think if you could update the PR with the change mentioned here and loop over the customizers to call |
Introduce the new callback interface TomcatProtocolHandlerCustomizer that can be used to customize the ProtocolHandler on a Tomcat Connector. Fixes #15035
I updated the PR. |
This commit introduces a new callback interface that can be used to customize the ProtocolHandler on a Tomcat Connector. See gh-16342
* pr/16342: Polish "Simplify the configuration of the ProtocolHandler" Simplify the configuration of the ProtocolHandler
@pas2al Thank you for making your first contribution to Spring Boot. This is now merged into master along with this polish commit. |
@mbhave Thank you very much for the opportunity and your support! |
Introduce the new callback interface TomcatProtocolHandlerCustomizer
that can be used to customize the ProtocolHandler on a Tomcat Connector.
Fixes #15035