[ 
https://issues.apache.org/jira/browse/SHINDIG-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626411#action_12626411
 ] 

John Hjelmstad commented on SHINDIG-500:
----------------------------------------

Well, since a "full" rewriting operation is the composition of rewrites 
performed by all ContentRewriters in the Registry, I think that's the logical 
best place for caching functionality to be added. As such, what I've done is 
the following:

1. Augment ContentRewriterRegistry with a new method 
rewriteGadget(GadgetContext, Gadget). This in turn - for now, until we clean up 
the ContentRewriter interface - just runs through all rewriters calling 
ContentRewriter.rewriteGadgetView(...).
  - While this somewhat conflates "registration" with rewriter execution, I 
think the combination makes reasonable sense. The registry should know how to 
execute the rewriters, in what order, with what optimizations, etc.
  - Note, this method signature is likely subject to change once CR's interface 
is simplified.

2. BasicContentRewriterRegistry implements this method by iterating through 
ContentRewriters. That's it.

3. Introduce CachingContentRewriterRegistry, which extends 
CachingWebRetrievalFactory. I just introduced this latter class (which already 
has a bad name... gotta fix that), which abstracts away all the caching 
behavior from BasicGadgetSpecFactory and BasicMessageBundleFactory (these two 
classes have been de-duplicated now, both extending the new one).
  - Because of the inheritance, CachingContentRewriterRegistry actually 
delegates to its own contained instance of BasicContentRewriterRegistry, 
basically using it as a helper class.
  - CCRR thus provides configured caching capability for rewritten Gadget 
objects.
  - Note, my implementation currently inherits the same configuration values as 
the gadget-spec cache for backward compatibility.

Thoughts on this approach? I'll attach a patch to this CL including this 
implementation shortly, after finishing some tests.

> Make Gadget Object's content that of the active View
> ----------------------------------------------------
>
>                 Key: SHINDIG-500
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-500
>             Project: Shindig
>          Issue Type: Sub-task
>          Components: Gadget Rendering Server (Java)
>            Reporter: John Hjelmstad
>            Assignee: John Hjelmstad
>         Attachments: spec-immutable-notdoneyet.patch
>
>
> Step #1 of 
> http://mail-archives.apache.org/mod_mbox/incubator-shindig-dev/200808.mbox/[EMAIL
>  PROTECTED]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to