camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bibr...@apache.org
Subject git commit: Use interface rather than concrete class during casting
Date Sat, 08 Mar 2014 12:43:25 GMT
Repository: camel
Updated Branches:
  refs/heads/master 335e6f725 -> 7c21b39bf


Use interface rather than concrete class during casting


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7c21b39b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7c21b39b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7c21b39b

Branch: refs/heads/master
Commit: 7c21b39bf713cec68b320405e25972a807607748
Parents: 335e6f7
Author: Bilgin Ibryam <bibryam@apache.org>
Authored: Sat Mar 8 12:43:02 2014 +0000
Committer: Bilgin Ibryam <bibryam@apache.org>
Committed: Sat Mar 8 12:43:02 2014 +0000

----------------------------------------------------------------------
 .../component/infinispan/InfinispanConsumer.java    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7c21b39b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
index b5051a6..cb5161a 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
@@ -20,7 +20,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
 import org.infinispan.Cache;
-import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -28,7 +28,7 @@ public class InfinispanConsumer extends DefaultConsumer {
     private static final transient Logger LOGGER = LoggerFactory.getLogger(InfinispanProducer.class);
     private final InfinispanConfiguration configuration;
     private final InfinispanSyncEventListener listener;
-    private DefaultCacheManager defaultCacheManager;
+    private EmbeddedCacheManager cacheManager;
 
     public InfinispanConsumer(InfinispanEndpoint endpoint, Processor processor, InfinispanConfiguration
configuration) {
         super(endpoint, processor);
@@ -56,13 +56,13 @@ public class InfinispanConsumer extends DefaultConsumer {
 
     @Override
     protected void doStart() throws Exception {
-        if (configuration.getCacheContainer() instanceof DefaultCacheManager) {
-            defaultCacheManager = (DefaultCacheManager) configuration.getCacheContainer();
+        if (configuration.getCacheContainer() instanceof EmbeddedCacheManager) {
+            cacheManager = (EmbeddedCacheManager) configuration.getCacheContainer();
             Cache<Object, Object> cache;
             if (configuration.getCacheName() != null) {
-                cache = defaultCacheManager.getCache(configuration.getCacheName());
+                cache = cacheManager.getCache(configuration.getCacheName());
             } else {
-                cache = defaultCacheManager.getCache();
+                cache = cacheManager.getCache();
             }
             cache.addListener(listener);
         } else {
@@ -73,8 +73,8 @@ public class InfinispanConsumer extends DefaultConsumer {
 
     @Override
     protected void doStop() throws Exception {
-        if (defaultCacheManager != null) {
-            defaultCacheManager.removeListener(listener);
+        if (cacheManager != null) {
+            cacheManager.removeListener(listener);
         }
         super.doStop();
     }


Mime
View raw message