On Wed, May 20, 2009 at 1:26 PM, <[email protected]> wrote: > Author: lindner > Date: Wed May 20 20:26:55 2009 > New Revision: 776834 > > URL: http://svn.apache.org/viewvc?rev=776834&view=rev > Log: > SHINDIG-1066 | Allow MakeRequestHandler to be subclassed, patch from Alex > at LinkedIn > > Modified: > > > incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestHandler.java > > Modified: > incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestHandler.java > URL: > http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestHandler.java?rev=776834&r1=776833&r2=776834&view=diff > > ============================================================================== > --- > incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestHandler.java > (original) > +++ > incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestHandler.java > Wed May 20 20:26:55 2009 > @@ -110,7 +110,7 @@ > * sent from the client. > * @throws GadgetException > */ > - private HttpRequest buildHttpRequest(HttpServletRequest request) throws > GadgetException { > + protected HttpRequest buildHttpRequest(HttpServletRequest request) > throws GadgetException { > String encoding = request.getCharacterEncoding(); > if (encoding == null) { > encoding = "UTF-8"; > @@ -179,7 +179,7 @@ > * Format a response as JSON, including additional JSON inserted by > * chained content fetchers. > */ > - private String convertResponseToJson(SecurityToken authToken, > HttpServletRequest request, > + protected String convertResponseToJson(SecurityToken authToken, > HttpServletRequest request, > HttpResponse results) throws GadgetException { > String originalUrl = request.getParameter(ProxyBase.URL_PARAM); > String body = ""; > @@ -203,6 +203,11 @@ > return JsonSerializer.serialize(Collections.singletonMap(originalUrl, > resp)); > } > > + protected RequestPipeline getRequestPipeline() > + { > + return requestPipeline; > + }
Why would you use this instead of just injecting the RequestPipeline itself? What if a sub class of MakeRequestHandler doesn't use a RequestPipeline at all? > > + > /** > * @param request > * @return A valid token for the given input. > > >

