Bean injection in Cache store implementation

classic Classic list List threaded Threaded
2 messages Options
Komal Chugh Komal Chugh
Reply | Threaded
Open this post in threaded view
|

Bean injection in Cache store implementation

I am overriding write method of cache store and using
FactoryBuilder.factoryOf method in the cache configuration. But I need to
inject spring bean in the cache store implementation. I tried using
@SpringResource by defining that bean in xml file, but there are a lot of
nested beans which are defined using java. Is there a way I can inject a
bean defined using java in cache store implementation?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Bean injection in Cache store implementation

Hello!

You can use @SpringApplicationContextResource to get the whole SpringContext.

Alternatively, you can have a custom factory which will initialize your bean properly. The factory is there for a reason.

Regards,
--
Ilya Kasnacheev


сб, 1 июн. 2019 г. в 23:12, Komal Chugh <[hidden email]>:
I am overriding write method of cache store and using
FactoryBuilder.factoryOf method in the cache configuration. But I need to
inject spring bean in the cache store implementation. I tried using
@SpringResource by defining that bean in xml file, but there are a lot of
nested beans which are defined using java. Is there a way I can inject a
bean defined using java in cache store implementation?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/