Jesse, Can you please explain the difference between BindingScopingVisitor.visitEagerSingleton() and visitScope(Scope scope)? I assume there is a reason you didn't just invoke visitScope (Scope.Singleton) instead of exposing a separate method?
Thanks, Gili On Oct 6, 9:25 pm, "Stuart McCulloch" <[EMAIL PROTECTED]> wrote: > 2008/10/7 Gili Tzabari <[EMAIL PROTECTED]> > > > > > Which new SPI? :) > > the one Jesse mentioned here... :) > > http://groups.google.com/group/google-guice/browse_thread/thread/5ccc... > > which will be a major part of the next release. > > > > > Gili > > > Stuart McCulloch wrote: > > > 2008/10/7 Gili <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > > > > Hi, > > > > Is it possible to detect the scope associated with Binding returned > > by > > > Injector.getBinding(Key)? I'm trying to detect at runtime whether a > > > user specified multiple Scopes from different frameworks, such as > > > Guice, Spring, and Jersey (JAX-RS) so I can throw an error. > > > > well in the current trunk Binding has a visitor method for scopes: > > > > /** > > > * Accepts a scoping visitor. Invokes the visitor method specific to > > > this binding's scoping. > > > * > > > * @param visitor to call back on > > > */ > > > <V> V acceptScopingVisitor(BindingScopingVisitor<V> visitor); > > > > which should do what you want... the new SPI looks very cool btw! > > > > PS: What happens when a user associates two scope annotations with > > the > > > same class? I assume it throws an error? > > > > yes, you should see an error (see ScopeBindingProcessor.java) > > > > Thanks, > > > Gili > > > > -- > > > Cheers, Stuart > > -- > Cheers, Stuart --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
