ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject incubator-ignite git commit: # Added temporary code to debug org.jsr107.tck.management.CacheMXBeanTest#testCustomConfiguration
Date Thu, 12 Feb 2015 17:46:56 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-56-tck [created] 2ebd5e1a8


# Added temporary code to debug org.jsr107.tck.management.CacheMXBeanTest#testCustomConfiguration


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

Branch: refs/heads/ignite-56-tck
Commit: 2ebd5e1a833371b00faaa0d04dce87ab05dce8ce
Parents: 422ffb1
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Thu Feb 12 16:31:31 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Thu Feb 12 20:46:19 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheManager.java   | 83 +++++++++++---------
 1 file changed, 44 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2ebd5e1a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index 38ce793..077734f 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -96,63 +96,68 @@ public class CacheManager implements javax.cache.CacheManager {
     /** {@inheritDoc} */
     @Override public <K, V, C extends Configuration<K, V>> Cache<K, V>
createCache(String cacheName, C cacheCfg)
         throws IllegalArgumentException {
-        ensureNotClosed();
+        try {
+            ensureNotClosed();
 
-        if (cacheCfg == null)
-            throw new NullPointerException();
+            if (cacheCfg == null)
+                throw new NullPointerException();
 
-        if (cacheName == null)
-            throw new NullPointerException();
+            if (cacheName == null)
+                throw new NullPointerException();
 
-        CacheConfiguration igniteCacheCfg;
+            CacheConfiguration igniteCacheCfg;
 
-        if (cacheCfg instanceof CompleteConfiguration)
-            igniteCacheCfg = new CacheConfiguration((CompleteConfiguration)cacheCfg);
-        else {
-            igniteCacheCfg = new CacheConfiguration();
+            if (cacheCfg instanceof CompleteConfiguration)
+                igniteCacheCfg = new CacheConfiguration((CompleteConfiguration)cacheCfg);
+            else {
+                igniteCacheCfg = new CacheConfiguration();
 
-            igniteCacheCfg.setTypes(cacheCfg.getKeyType(), cacheCfg.getValueType());
-            igniteCacheCfg.setStoreValueBytes(cacheCfg.isStoreByValue());
-        }
+                igniteCacheCfg.setTypes(cacheCfg.getKeyType(), cacheCfg.getValueType());
+                igniteCacheCfg.setStoreValueBytes(cacheCfg.isStoreByValue());
+            }
 
-        igniteCacheCfg.setName(cacheName);
+            igniteCacheCfg.setName(cacheName);
 
-        IgniteCache<K, V> res;
+            IgniteCache<K, V> res;
 
-        synchronized (igniteMap) {
-            if (igniteMap.containsKey(cacheName))
-                throw new CacheException("Cache already exists [cacheName=" + cacheName +
", manager=" + uri + ']');
+            synchronized (igniteMap) {
+                if (igniteMap.containsKey(cacheName))
+                    throw new CacheException("Cache already exists [cacheName=" + cacheName
+ ", manager=" + uri + ']');
 
-            Ignite ignite;
+                Ignite ignite;
 
-            if (uri.equals(cachingProvider.getDefaultURI())) {
-                IgniteConfiguration cfg = new IgniteConfiguration();
-                cfg.setGridName(mgrIdx.incrementAndGet() + "-grid-for-" + cacheName);
+                if (uri.equals(cachingProvider.getDefaultURI())) {
+                    IgniteConfiguration cfg = new IgniteConfiguration();
+                    cfg.setGridName(mgrIdx.incrementAndGet() + "-grid-for-" + cacheName);
 
-                cfg.setCacheConfiguration(igniteCacheCfg);
+                    cfg.setCacheConfiguration(igniteCacheCfg);
 
-                try {
-                    ignite = Ignition.start(cfg);
-                }
-                catch (IgniteException e) {
-                    throw new CacheException(e);
+                    try {
+                        ignite = Ignition.start(cfg);
+                    }
+                    catch (IgniteException e) {
+                        throw new CacheException(e);
+                    }
                 }
-            }
-            else
-                throw new UnsupportedOperationException();
+                else
+                    throw new UnsupportedOperationException();
 
-            res = ignite.jcache(cacheName);
+                res = ignite.jcache(cacheName);
 
-            igniteMap.put(cacheName, ignite);
-        }
+                igniteMap.put(cacheName, ignite);
+            }
 
-        if (igniteCacheCfg.isManagementEnabled())
-            enableManagement(cacheName, true);
+            if (igniteCacheCfg.isManagementEnabled())
+                enableManagement(cacheName, true);
 
-        if (igniteCacheCfg.isStatisticsEnabled())
-            enableStatistics(cacheName, true);
+            if (igniteCacheCfg.isStatisticsEnabled())
+                enableStatistics(cacheName, true);
 
-        return res;
+            return res;
+        }
+        catch (UnsupportedOperationException e) {
+            throw new RuntimeException(e);
+        }
     }
 
     /**


Mime
View raw message