Hi,

Just summarizing from our discussions on IRC:

Yes, this is what it would take to make this work. I also like your 
AsyncBeanFactory approach because it simplifies the generated code.

To decide what code to generate at rebind time (new vs. bean manager lookup) 
you can use RebindUtils.getInheritedModules() to check if Errai IOC is 
available.

As an immediate solution (workaround that doesn't require any change), you can 
lookup beans within interceptor implementations using 
IOC.getBeanManager().lookupBean().

Cheers,
Christian

On 2014-02-11, at 1:54 PM, Eric Wittmann <[email protected]> wrote:

> My use case is that I want an Auth interceptor which would support both BASIC 
> and Bearer Token authentication depending on the app's configuration.  My 
> config information is accessible via a @ApplicationScoped client service 
> (ConfigurationService).  I would like to inject that into my interceptor.  
> Currently the interceptors are simply new'd up when needed.
> 
> I think we need to make interceptor creation asynchronous so that the async 
> bean manager in IOC can be (optionally) used.  Attached to this email are 
> there files:
> 
> samplecode.txt - code generated now (e.g. JaxrsProxyLoaderImpl.java)
> samplecode-async.txt - suggestion for how to make it async
> samplecode-ioc.txt - optional code generation iff the IOC module is present
> 
> Thoughts?
> 
> I could take a stab at this if it seems reasonable, but I don't want to start 
> down this road if anyone can spot a glaring problem.
> 
> Also notice that I removed the return value for proceed() as I do not believe 
> it is required/used.
> 
> -Eric
> <samplecode-async.txt><samplecode-ioc.txt><samplecode.txt>_______________________________________________
> errai-dev mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/errai-dev


_______________________________________________
errai-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/errai-dev

Reply via email to