You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Prasad Bhalerao <pr...@gmail.com> on 2018/02/12 12:50:32 UTC

Autowire in CacheStore implementation

Hi,

Does anyone have any idea, how to autowire dependency in CacheStore
implementation?
To set cacheStore implementation in cache configuration we use following
code.

CacheConfiguration.setCacheStoreFactory().

Now this method accepts the Factory implementation which instantiates the
CacheStore implementation. Now this bean is not spring managed bean. How to
autowire datasource in cache store implementation?

Thanks,
Prasad

Re: Autowire in CacheStore implementation

Posted by dkarachentsev <dk...@gridgain.com>.
Hi Prasad,

If you started Ignite with IgniteSpringBean or IgniteSpring try
@SpringApplicationContextResource [1] annotation. Ignite's resource injector
will use spring context to set a dependency annotated by it. But I'm not
sure that this will work with CacheStore, it should be rechecked.

[1]
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/resources/SpringApplicationContextResource.html

Thanks!
-Dmitry



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