|
|
Introduces new interface HttpResponseRewriter, and for the moment - as a proof-of-concept and for functional backward compatibility - implements only BasicImageRewriter in terms of this interface.
HttpResponseRewriter's API parallels that of GadgetRewriter:
void rewrite(ContextObject in, MutableContent out);
Specifically:
void rewrite(HttpRequest in, HttpResponseBuilder out);
This change thus utilizes the HttpResponseBuilder-as-MutableContent CL submitted a few weeks ago.
Additional notes:
* [Basic]ImageRewriter simply modifies an HttpResponse. Its implementation is updated in this CL to reflect the same.
* HttpResponseRegistry is introduced, with default binding to BasicImageRewriter. The registry's rewriters are executed at the same place as ImageRewriter previously was - in DefaultRequestPipeline, after fetch and before caching.
* HttpResponseBuilder optimization implemented to return the "source" HttpResponse object from which it was created when no changes were made to its data. This avoids pointless object creation and data copying, maintaining ImageRewriter's performance in such cases.
This CL is transitional, as its goals are to move to the following:
* Ability to perform image rewriting steps independently, in separate rewriting passes (resizing, optimization, downsampling, format conversion, and so on).
* Situation in which all RequestRewriters are made into ResponseRewriters, removing one Rewriter type.
* Ability to precisely define the caching characteristics of [Response]Rewriters, of any type.
Total comments: 1
Total comments: 1
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+382 lines, -171 lines) |
Patch |
 |
|
UPGRADING
|
View
|
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/DefaultRequestPipeline.java
|
View
|
|
4 chunks |
+11 lines, -5 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/HttpResponseBuilder.java
|
View
|
|
9 chunks |
+59 lines, -18 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/DefaultResponseRewriterRegistry.java
|
View
|
1
|
1 chunk |
+61 lines, -0 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ResponseRewriter.java
|
View
|
|
1 chunk |
+25 lines, -0 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ResponseRewriterRegistry.java
|
View
|
|
1 chunk |
+40 lines, -0 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewriteModule.java
|
View
|
|
2 chunks |
+8 lines, -0 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/BMPOptimizer.java
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/BaseOptimizer.java
|
View
|
|
5 chunks |
+11 lines, -13 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/BasicImageRewriter.java
|
View
|
|
14 chunks |
+47 lines, -68 lines |
1 comment
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/GIFOptimizer.java
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/JPEGOptimizer.java
|
View
|
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/image/PNGOptimizer.java
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/AbstractHttpCacheTest.java
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/AbstractHttpFetcherTest.java
|
View
|
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/DefaultInvalidationServiceTest.java
|
View
|
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/DefaultRequestPipelineTest.java
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/http/HttpResponseBuilderTest.java
|
View
|
|
1 chunk |
+28 lines, -1 line |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/BMPOptimizerTest.java
|
View
|
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/GIFOptimizerTest.java
|
View
|
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/ImageRewriterTest.java
|
View
|
|
6 chunks |
+40 lines, -38 lines |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/JPEGOptimizerTest.java
|
View
|
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
|
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/image/PNGOptimizerTest.java
|
View
|
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
Total messages: 8
|