See change http://codereview.appspot.com/2996041/ Basically keep list binding, but then add multi-binding that will is converted to list.
On Mon, Nov 8, 2010 at 2:42 PM, John Hjelmstad (JIRA) <[email protected]>wrote: > > [ > https://issues.apache.org/jira/browse/SHINDIG-1456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel] > > John Hjelmstad reassigned SHINDIG-1456: > --------------------------------------- > > Assignee: Ziv Horesh > > @Ziv, can you take this one? > > > Extend rewriter capability for Shindig > > -------------------------------------- > > > > Key: SHINDIG-1456 > > URL: https://issues.apache.org/jira/browse/SHINDIG-1456 > > Project: Shindig > > Issue Type: Improvement > > Components: Java > > Affects Versions: 3.0.0 > > Reporter: Kai Feng Zhang > > Assignee: Ziv Horesh > > Fix For: 3.0.0 > > > > Attachments: multibind_rewriters_20101029.patch, > multibind_rewriters_20101102.patch > > > > > > I'd like to add a custom rewriter into Shindig, with requirement of no > need to change Shindig rendering gadget server side code directly. I want to > add it as a new feature in extras, so when this feature is required by > gadget, the custom rewriter will do some special work when rendering gadget > at server side. > > But I checked Shindig code, RewriteModule @Provides all predefined > rewriters with @Named("shindig.rewriters.gadget") , and then > GadgetRewritersProvider will provide all rewriters as per the same @Name > when rendering gadget. > > If I create a new Module in shindig extras, and @Provides custom rewriter > with same @Name, and startup server, there will be error saying the same > @Name is configured already by RewriteModule. > > ----------------------------- > > I have a solution to this, using multibinding in Guice, see Please see: > http://google-guice.googlecode.com/svn/trunk/latest-javadoc/com/google/inject/multibindings/Multibinder.html > > There are some changes need to be made at RewriteModule to use > Multibinder to bind rewriters, and change GadgetRewriter collection type > from List to Set in GadgetRewritersProvider, then it's easy to bind any new > custom rewriter in extras module. > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > >
