| Summary: | Making ProxyServlet even more extensible | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Michael Gorovoy <mgorovoy> |
| Component: | server | Assignee: | Simone Bordet <simone.bordet> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | gregw, jesse.mcconnell, jetty-inbox, simone.bordet |
| Version: | 7.6.1 | ||
| Target Milestone: | 9.0.0.RC1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Michael Gorovoy
Could you explain what your planning to do here a bit more? I am curious how your planning on doing it :) My original idea was to make the anonymous HttpExchange subclass into an inner class and create a createHttpExchange() method that would actually create the object of this inner class, so that I could subclass that inner class and override behavior of some methods. However when I started doing a proof of concept last night, I realized that there is a very tight integration between the exchange object and the continuation handling that could be easily upset by using a subclass. I'm currently thinking about following the pattern that was introduced earlier by creating methods handleRequestCommitted(), handleRequestComplete(), handleResponseStatus(), handleResponseHeader(), handleResponseHeaderComplete(), handleResponseContent(), handleResponseComplete() in the ProxyServlet class that will all have HttpServletRequest and HttpServletResponse parameters in addition to the parameters that are passed to the respective HttpExchange methods, and will contain the code that is currently located in the respective HttpExchange methods except for the logging part that will stay where it currently is. What behavior of the http exchange do you need to override/modify? maybe that will help tease out a good mechanic for this This is currently implemented in Jetty 9's ProxyServlet. It features hooks to rewrite URLs, to customize the request before it is sent, and to customize various response steps via onResponse*() methods. |