Which new SPI? :)

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
>
> >

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to