Thank you Paul. I think you are right that we need to make rewriters
implement Comparable interface. See doc from Guice:

The set's iteration order is consistent with the binding order. This is
> convenient when multiple elements are contributed by the same module because
> that module can order its bindings appropriately. Avoid relying on the
> iteration order of elements contributed by different modules, since there is
> no equivalent mechanism to order modules.



Thanks,

Kevin Zhang (凯峰)
Gtalk:   [email protected]
Blog:    http://www.zhangkf.com
Twitter: http://twitter.com/zhangkf


On Fri, Oct 29, 2010 at 8:22 PM, Paul Lindner <[email protected]> wrote:

> I think this is a good idea, however I'm concerned that the ordering of
> Rewriters may be important.
>
> I'm guessing that we could make a SortedSet if we had a Comparable<>
> implementation of all rewriters.
>
> On Fri, Oct 29, 2010 at 1:23 AM, Kai Feng Zhang <[email protected]>
> wrote:
>
> > I found a possible solution to extend Shindig rewriter capability, using
> > multibinding in Guice.
> >
> > Please see:
> >
> >
> http://google-guice.googlecode.com/svn/trunk/latest-javadoc/com/google/inject/multibindings/Multibinder.html
> >
> > I created a jira for this, see
> > https://issues.apache.org/jira/browse/SHINDIG-1456
> >
> >
> >
> > On Fri, Oct 29, 2010 at 3:02 PM, Kai Feng Zhang <[email protected]>
> > wrote:
> >
> > > Hi,
> > >
> > > 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.
> > >
> > > Can anyone please help if there is some way to append such a rewriter
> > > without touching any existing Shindig gadget rendering code? Or that is
> > the
> > > only way to extend a new rewriter for gadget rendering?
> > >
> > > Thanks a lot!
> > >
> >
>
>
>
> --
> Paul Lindner -- [email protected] -- linkedin.com/in/plindner
>

Reply via email to