ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [07/25] incubator-ignite git commit: #ignite-960: Use @SpringApplicationContextResource annotation.
Date Tue, 16 Jun 2015 16:18:31 GMT
#ignite-960: Use @SpringApplicationContextResource annotation.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/50d14032
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/50d14032
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/50d14032

Branch: refs/heads/ignite-sprint-6
Commit: 50d14032c3b43433aa39a59ff7170ac547058a37
Parents: 4d5f603
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Jun 2 12:02:19 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Jun 2 12:02:19 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheProcessor.java |  3 +++
 .../cache/store/jdbc/CacheJdbcBlobStoreFactory.java   |  4 ++--
 modules/spring/src/test/config/store-cache.xml        |  2 --
 .../store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 14 +++++++-------
 4 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 0e1a9c2..354172a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1052,6 +1052,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     {
         assert cfg != null;
 
+        if (cfg.getCacheStoreFactory() != null)
+            ctx.resource().injectGeneric(cfg.getCacheStoreFactory());
+
         CacheStore cfgStore = cfg.getCacheStoreFactory() != null ? cfg.getCacheStoreFactory().create()
: null;
 
         validate(ctx.config(), cfg, cacheType, cfgStore);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
b/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
index fab5ee8..5f51c12 100644
--- a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ b/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.cache.store.jdbc;
 
 import org.apache.ignite.internal.util.tostring.*;
-import org.springframework.beans.factory.annotation.*;
+import org.apache.ignite.resources.*;
 import org.springframework.context.*;
 
 import javax.cache.configuration.*;
@@ -97,7 +97,7 @@ public class CacheJdbcBlobStoreFactory  implements Factory<CacheJdbcBlobStore>
{
     private String dataSrcBean;
 
     /** Application context. */
-    @Autowired
+    @SpringApplicationContextResource
     private ApplicationContext appContext;
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/modules/spring/src/test/config/store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/store-cache.xml b/modules/spring/src/test/config/store-cache.xml
index af5928b..992a22c 100644
--- a/modules/spring/src/test/config/store-cache.xml
+++ b/modules/spring/src/test/config/store-cache.xml
@@ -22,8 +22,6 @@
         http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-    <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
-
     <bean id="simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
 
     <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
index 0c7c933..bdfdcb9 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -29,15 +29,15 @@ import org.h2.jdbcx.*;
 public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
     public void testXmlConfiguration() throws Exception {
         try (Ignite ignite = Ignition.start("modules/spring/src/test/config/store-cache.xml"))
{
-            try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache("test"))
{
-                CacheJdbcBlobStore store = (CacheJdbcBlobStore)cache.getConfiguration(CacheConfiguration.class).
-                    getCacheStoreFactory().create();
+            IgniteCache<Integer, String> cache = ignite.cache("test");
 
-                assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class,
"user"));
+            CacheJdbcBlobStore store = (CacheJdbcBlobStore) cache.getConfiguration(CacheConfiguration.class).
+                getCacheStoreFactory().create();
 
-                assertEquals(JdbcDataSource.class,
-                    GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
-            }
+            assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class,
"user"));
+
+            assertEquals(JdbcDataSource.class,
+                GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
         }
     }
 }


Mime
View raw message