DescriptionRefactoring servlets by adding additional methods:
HttpRequest buildHttpRequest(HttpServletRequest request);
HttpResponse processRequest(HttpRequest request);
This results in added logical separation of common tasks performed by servlets (parsing and generating an http request, fetching the undelying resources, processing the request and convering http response to http servlet response to be sent to user.
Also, this will allow us to cache responses served by these servlets more easily. Then we can add simple logic along the lines of:
- If precached, serve out previously served response directly.
- If not, generate the response for given request and then add to cache.
This can be useful to at least servlets like MakeRequestServlet, ConcatServlet, AccelServlet etc..
Comments welcome.
Created a jira issue for the same: https://issues.apache.org/jira/browse/SHINDIG-1381
PLEASE NOTE: This is a rough changelist. Its aim is to gather feedback on the suggested refactoring. It can be polished later if you feel the idea is good. So please focus on the API and interface changes in ProxyBase, AccelHandler, MakeRequestHandler and ProxyHandler.
Patch Set 1 #Patch Set 2 : fixing accel servlet tests #Patch Set 3 : fixing tests #Patch Set 4 : fixing tests #
Total comments: 20
Patch Set 5 : addressing comments #Patch Set 6 : fixing bad things #Patch Set 7 : 'updating_patch_after_svn_up' #
Total comments: 8
Patch Set 8 : 'resolving_conflicts_after_merge' #Patch Set 9 : 'more_refactoring' #Patch Set 10 : 'more_refactoring' #Patch Set 11 : 'more_refactoring' #
Total comments: 1
MessagesTotal messages: 13
|