-
1. Re: Injection in RpcInterceptor not working
csa Mar 12, 2013 9:42 PM (in response to shadogray)This is not supported in Errai 2.x but will soon be supported in Errai 3. For now you will need to use the BeanManager API to look up bean instances in interceptors: IOC.getBeanManager().lookupBean(SimpleEvent.class)
To provide some context: The remote interceptors (for RPC and REST calls) need to work without IOC (in case you build a plain Errai Bus or Errai JAXRS app). So, at rebind time we need to detect that Errai IOC will be available and then generate different interceptor code.
Cheers,
Christian
-
2. Re: Injection in RpcInterceptor not working
csa Mar 12, 2013 10:02 PM (in response to csa)I just realized you wrote that SimpleEvent was correctly injected, but I don't think that's possible, since the interceptor instance is created using the new operator. The simplest workaround to get to an injected event right now is to inject it into another bean and then look up that other bean using the BeanManager API as described above.
-
3. Re: Injection in RpcInterceptor not working
shadogray Mar 13, 2013 5:35 AM (in response to csa)works like a charm :-)
Thank you,
Thomas