Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(390)

Issue 2058042: Refactoring ResponseRewriterRegistry to take into account container (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by gagan.goku
Modified:
15 years, 1 month ago
Reviewers:
johnfargo, zhoresh, Kuntal Loya, anupama.dutta, cool-shindig-committers
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

Refactoring ResponseRewriterRegistry to take into account the container of the request being processed. This change adds a ContextAwareRegistry which determines the list of rewriters to apply using the container of the http request being processed and the rewrite flow id specified. Each handler (ProxyHandler , AccelHandler etc.) injects ResponseRewriterRegistry and specifies the rewrite flow id as shown below: @ResponseRewriters(rewriteFlow="accelerate") ResponseRewriterRegistry @ResponseRewriters(rewriteFlow="requestPipeline") ResponseRewriterRegistry @ResponseRewriters(rewriteFlow="default") ResponseRewriterRegistry ResponseRewriters for a given rewrite flow and container are provided as follows: @Provides @Singleton @ResponseRewritersList(rewriteFlow="accelerate", container="default") protected List<ResponseRewriter> provide() { return ImmutableList.of(absolutePathReferenceRewriter); } .... A RewritePath is defined as a tuple of (container, rewriteFlow). A map [RewritePath -> List of rewriters] is then generated by injecting all the ResponseRewritersList's.

Patch Set 1 #

Patch Set 2 : 'uploading_current_partial_changes' #

Patch Set 3 : 'uploading_current_partial_changes' #

Patch Set 4 : 'more_changes' #

Patch Set 5 : uploading_from_linux_after_patching #

Patch Set 6 : partial_upload #

Patch Set 7 : partial_upload #

Patch Set 8 : partial_upload #

Patch Set 9 : partial_upload #

Patch Set 10 : partial_upload #

Patch Set 11 : messy_upload #

Patch Set 12 : another_messy_upload #

Patch Set 13 : looking_cleaner_now #

Patch Set 14 : reducing_diffs #

Patch Set 15 : reducing_diffs #

Patch Set 16 : reducing_diffs #

Patch Set 17 : reducing_diffs #

Patch Set 18 : atuls_best #

Patch Set 19 : 'some_more_beautification' #

Patch Set 20 : 'some_more_beautification' #

Patch Set 21 : 'some_more_beautification' #

Patch Set 22 : 'some_more_stringent_checking' #

Patch Set 23 : 'looking_good_now' #

Patch Set 24 : 'looking_good_now' #

Total comments: 8

Patch Set 25 : addressing_kuntals_comments #

Patch Set 26 : small_changes #

Patch Set 27 : moving_list_to_provider #

Total comments: 2

Patch Set 28 : removing AccelResponseRewriterRegistry and making bind logic static so any1 can use it #

Patch Set 29 : removing AccelResponseRewriterRegistry and making bind logic static so any1 can use it #

Patch Set 30 : removing AccelResponseRewriterRegistry and making bind logic static so any1 can use it #

Patch Set 31 : svn up #

Patch Set 32 : addressing Zivs comment #

Patch Set 33 : addressing Zivs comment #

Total comments: 4

Patch Set 34 : svn up #

Patch Set 35 : addressing anupamas comments #

Patch Set 36 : addressing anupamas comments #

Patch Set 37 : uploading correct patch with all files #

Patch Set 38 : svn up #

Patch Set 39 : adding ResponseRegistry import #

Total comments: 6

Patch Set 40 : making RewriteFlow an enum #

Patch Set 41 : svn up #

Patch Set 42 : removing class method iteration logic and adding simpler registry provider methods #

Patch Set 43 : using ContainerConfig.DEFAULT_CONTAINER instead of "default" #

Patch Set 44 : removing RewriterRegistryImpl #

Patch Set 45 : something working with MapBinder. Ignoring style and other issues #

Patch Set 46 : reverting web.xml #

Patch Set 47 : reverting web.xml #

Total comments: 4

Patch Set 48 : addressing fargo's comments #

Patch Set 49 : addressing fargo's comments #

Patch Set 50 : svn up #

Total comments: 10

Patch Set 51 : addressing fargos comments #

Patch Set 52 : svn up #

Unified diffs Side-by-side diffs Delta from patch set Stats (+621 lines, -91 lines) Patch
M java/gadgets/src/main/java/org/apache/shindig/gadgets/http/DefaultRequestPipeline.java View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 2 chunks +4 lines, -5 lines 0 comments Download
D java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/AccelResponseRewriterRegistry.java View 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 1 chunk +0 lines, -56 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java View 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 1 chunk +86 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ResponseRewriterList.java View 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 1 chunk +34 lines, -0 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ResponseRewriterRegistry.java View 2 3 4 5 6 23 40 41 42 43 44 45 46 47 48 49 50 51 1 chunk +1 line, -0 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 3 chunks +100 lines, -27 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewritePath.java View 48 49 50 1 chunk +66 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriterRegistry.java View 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +40 lines, -0 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/AccelHandler.java View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 2 chunks +3 lines, -1 line 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ConcatProxyServlet.java View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 2 chunks +4 lines, -1 line 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/HttpRequestHandler.java View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 2 chunks +4 lines, -0 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestHandler.java View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 2 chunks +3 lines, -0 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyHandler.java View 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 2 chunks +5 lines, -1 line 0 comments Download
A java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistryTest.java View 32 33 37 38 39 40 41 42 43 44 45 46 47 1 chunk +146 lines, -0 lines 0 comments Download
A java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/RewriteModuleTest.java View 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 1 chunk +125 lines, -0 lines 0 comments Download

Messages

Total messages: 16
gagan.goku
15 years, 4 months ago (2010-08-29 06:49:39 UTC) #1
Kuntal Loya
Could we have the responseRewriterRegistry implementation have the flow information as well? Right now, I ...
15 years, 4 months ago (2010-09-01 08:09:03 UTC) #2
gagan.goku
http://codereview.appspot.com/2058042/diff/15020/9013 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java (right): http://codereview.appspot.com/2058042/diff/15020/9013#newcode36 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java:36: protected final Map<String, List<ResponseRewriter>> containerToResponseRewriters; On 2010/09/01 08:09:04, Kuntal ...
15 years, 4 months ago (2010-09-07 05:59:29 UTC) #3
zhoresh
http://codereview.appspot.com/2058042/diff/53001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java (right): http://codereview.appspot.com/2058042/diff/53001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java#newcode40 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java:40: protected final Map<Pair<String, String>, Provider<List<ResponseRewriter>>> responseRewriters; I think Map<String, ...
15 years, 4 months ago (2010-09-15 21:25:13 UTC) #4
gagan.goku
http://codereview.appspot.com/2058042/diff/53001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java (right): http://codereview.appspot.com/2058042/diff/53001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java#newcode40 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContextAwareRegistry.java:40: protected final Map<Pair<String, String>, Provider<List<ResponseRewriter>>> responseRewriters; On 2010/09/15 21:25:13, ...
15 years, 3 months ago (2010-10-03 20:40:55 UTC) #5
anupama.dutta
http://codereview.appspot.com/2058042/diff/72001/java/common/src/main/java/org/apache/shindig/common/Pair.java File java/common/src/main/java/org/apache/shindig/common/Pair.java (right): http://codereview.appspot.com/2058042/diff/72001/java/common/src/main/java/org/apache/shindig/common/Pair.java#newcode36 java/common/src/main/java/org/apache/shindig/common/Pair.java:36: @Override Probably can be moved to a separate patch, ...
15 years, 3 months ago (2010-10-12 04:37:40 UTC) #6
gagan.goku
http://codereview.appspot.com/2058042/diff/72001/java/common/src/main/java/org/apache/shindig/common/Pair.java File java/common/src/main/java/org/apache/shindig/common/Pair.java (right): http://codereview.appspot.com/2058042/diff/72001/java/common/src/main/java/org/apache/shindig/common/Pair.java#newcode36 java/common/src/main/java/org/apache/shindig/common/Pair.java:36: @Override On 2010/10/12 04:37:41, anupama.dutta wrote: > Probably can ...
15 years, 3 months ago (2010-10-12 08:28:28 UTC) #7
johnfargo
Pretty slick! But unfortunately it limits our utility, while the code is fairly confusing as ...
15 years, 3 months ago (2010-10-15 00:32:45 UTC) #8
gagan.goku
Hi John Thanks for spending time on this cl. Responses inline: On Fri, Oct 15, ...
15 years, 3 months ago (2010-10-15 19:32:08 UTC) #9
gagan.goku
Hi Fargo Could you respond to my comments? Thanks Gagan
15 years, 2 months ago (2010-10-19 03:08:31 UTC) #10
johnfargo
This seems more aligned w/ Guice's features, though again, it's a bit of a hexagonal ...
15 years, 2 months ago (2010-10-27 23:37:24 UTC) #11
gagan.goku
http://codereview.appspot.com/2058042/diff/116001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java (right): http://codereview.appspot.com/2058042/diff/116001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java#newcode59 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java:59: MapBinder<String, Map<RewriteFlow, Provider<List<ResponseRewriter>>>> mapbinder = On 2010/10/27 23:37:24, johnfargo ...
15 years, 2 months ago (2010-10-29 10:07:09 UTC) #12
johnfargo
Looks pretty good to me at this point. The multibinding stuff is a little confusing, ...
15 years, 1 month ago (2010-11-17 02:01:26 UTC) #13
gagan.goku
http://codereview.appspot.com/2058042/diff/126001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java (right): http://codereview.appspot.com/2058042/diff/126001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java#newcode84 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java:84: Provider<List<ResponseRewriter>> list) { On 2010/11/17 02:01:26, johnfargo wrote: > ...
15 years, 1 month ago (2010-11-17 04:15:09 UTC) #14
johnfargo
LGTM On 2010/11/17 04:15:09, gagan.goku wrote: > http://codereview.appspot.com/2058042/diff/126001/java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java > File > java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java > (right): > ...
15 years, 1 month ago (2010-11-17 07:00:07 UTC) #15
gagan.goku
15 years, 1 month ago (2010-11-17 07:38:09 UTC) #16
svn uped.
Build looks good.
Committed as r1035940.

Thanks for the reviews everyone.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b