You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/02/13 09:18:31 UTC
[1/3] git commit: CAMEL-7195 logging the Ehcache config used
Updated Branches:
refs/heads/camel-2.12.x 30e2acac1 -> d94b65fb5
refs/heads/master 6b0f91f1d -> 30b6ccd9c
CAMEL-7195 logging the Ehcache config used
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1366827d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1366827d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1366827d
Branch: refs/heads/master
Commit: 1366827d91c6224dcab3908b6e3d1de450558e9f
Parents: 80402cb
Author: Grzegorz Grzybek <gr...@gmail.com>
Authored: Thu Feb 13 09:09:25 2014 +0100
Committer: Grzegorz Grzybek <gr...@gmail.com>
Committed: Thu Feb 13 09:09:25 2014 +0100
----------------------------------------------------------------------
.../apache/camel/component/cache/CacheComponent.java | 2 +-
.../component/cache/DefaultCacheManagerFactory.java | 14 ++++++++++++--
.../cache/DefaultCacheManagerFactoryTest.java | 4 ++--
3 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/1366827d/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
index 1ae2f61..21f1bf1 100755
--- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
+++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
@@ -99,7 +99,7 @@ public class CacheComponent extends DefaultComponent {
if (configurationFile != null) {
is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), configurationFile);
}
- cacheManagerFactory = new DefaultCacheManagerFactory(is);
+ cacheManagerFactory = new DefaultCacheManagerFactory(is, configurationFile);
}
ServiceHelper.startService(cacheManagerFactory);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/1366827d/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
index dad682f..69cf3f7 100644
--- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
+++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
@@ -19,26 +19,36 @@ package org.apache.camel.component.cache;
import java.io.InputStream;
import net.sf.ehcache.CacheManager;
+
+import org.apache.camel.impl.DefaultComponent;
import org.apache.camel.util.IOHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class DefaultCacheManagerFactory extends CacheManagerFactory {
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultCacheManagerFactory.class);
private InputStream is;
+ private String configurationFile;
+
public DefaultCacheManagerFactory() {
- this(null);
+ this(null, null);
}
- public DefaultCacheManagerFactory(InputStream is) {
+ public DefaultCacheManagerFactory(InputStream is, String configurationFile) {
this.is = is;
+ this.configurationFile = configurationFile;
}
@Override
protected CacheManager createCacheManagerInstance() {
if (is == null) {
// it will still look for "/ehcache.xml" before defaulting to "/ehcache-failsafe.xml"
+ LOG.info("Creating CacheManager using Ehcache defaults");
return EHCacheUtil.createCacheManager();
}
+ LOG.info("Creating CacheManager using camel-cache configuration: {}", configurationFile);
return EHCacheUtil.createCacheManager(is);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/1366827d/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java b/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
index 5f2dc4f..af8e786 100644
--- a/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
@@ -60,7 +60,7 @@ public class DefaultCacheManagerFactoryTest extends Assert {
@Test
public void testNoProvidedConfiguration() throws Exception {
- CacheManagerFactory factory = new DefaultCacheManagerFactory(getClass().getResourceAsStream("/ehcache.xml"));
+ CacheManagerFactory factory = new DefaultCacheManagerFactory(getClass().getResourceAsStream("/ehcache.xml"), "/ehcache.xml");
CacheManager manager = factory.getInstance();
// CAMEL-7195
assertThat("There should be no peer providers configured", manager.getCacheManagerPeerProviders().size(), is(0));
@@ -69,7 +69,7 @@ public class DefaultCacheManagerFactoryTest extends Assert {
@Test
public void testFailSafeEHCacheManager() throws Exception {
- CacheManagerFactory factory1 = new DefaultCacheManagerFactory(null);
+ CacheManagerFactory factory1 = new DefaultCacheManagerFactory(null, null);
CacheManagerFactory factory2 = new DefaultCacheManagerFactory();
assertSame("The cache managers should be the same, loaded from fallback ehcache config",
factory1.getInstance(), factory2.getInstance());
[2/3] git commit: Merge branch 'CAMEL-7195' of
https://github.com/grgrzybek/camel
Posted by da...@apache.org.
Merge branch 'CAMEL-7195' of https://github.com/grgrzybek/camel
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/30b6ccd9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/30b6ccd9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/30b6ccd9
Branch: refs/heads/master
Commit: 30b6ccd9c87d84c5a82fb5a91ff69e700fda94fb
Parents: 6b0f91f 1366827
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Feb 13 09:16:44 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Feb 13 09:16:44 2014 +0100
----------------------------------------------------------------------
.../apache/camel/component/cache/CacheComponent.java | 2 +-
.../component/cache/DefaultCacheManagerFactory.java | 14 ++++++++++++--
.../cache/DefaultCacheManagerFactoryTest.java | 4 ++--
3 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
[3/3] git commit: CAMEL-7195 logging the Ehcache config used
Posted by da...@apache.org.
CAMEL-7195 logging the Ehcache config used
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d94b65fb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d94b65fb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d94b65fb
Branch: refs/heads/camel-2.12.x
Commit: d94b65fb50c3ea2e2e7609d2fc7d10da80a6b664
Parents: 30e2aca
Author: Grzegorz Grzybek <gr...@gmail.com>
Authored: Thu Feb 13 09:09:25 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Feb 13 09:19:43 2014 +0100
----------------------------------------------------------------------
.../apache/camel/component/cache/CacheComponent.java | 2 +-
.../component/cache/DefaultCacheManagerFactory.java | 14 ++++++++++++--
.../cache/DefaultCacheManagerFactoryTest.java | 4 ++--
3 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/d94b65fb/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
index 1ae2f61..21f1bf1 100755
--- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
+++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java
@@ -99,7 +99,7 @@ public class CacheComponent extends DefaultComponent {
if (configurationFile != null) {
is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), configurationFile);
}
- cacheManagerFactory = new DefaultCacheManagerFactory(is);
+ cacheManagerFactory = new DefaultCacheManagerFactory(is, configurationFile);
}
ServiceHelper.startService(cacheManagerFactory);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/d94b65fb/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
index dad682f..69cf3f7 100644
--- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
+++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/DefaultCacheManagerFactory.java
@@ -19,26 +19,36 @@ package org.apache.camel.component.cache;
import java.io.InputStream;
import net.sf.ehcache.CacheManager;
+
+import org.apache.camel.impl.DefaultComponent;
import org.apache.camel.util.IOHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class DefaultCacheManagerFactory extends CacheManagerFactory {
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultCacheManagerFactory.class);
private InputStream is;
+ private String configurationFile;
+
public DefaultCacheManagerFactory() {
- this(null);
+ this(null, null);
}
- public DefaultCacheManagerFactory(InputStream is) {
+ public DefaultCacheManagerFactory(InputStream is, String configurationFile) {
this.is = is;
+ this.configurationFile = configurationFile;
}
@Override
protected CacheManager createCacheManagerInstance() {
if (is == null) {
// it will still look for "/ehcache.xml" before defaulting to "/ehcache-failsafe.xml"
+ LOG.info("Creating CacheManager using Ehcache defaults");
return EHCacheUtil.createCacheManager();
}
+ LOG.info("Creating CacheManager using camel-cache configuration: {}", configurationFile);
return EHCacheUtil.createCacheManager(is);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/d94b65fb/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java b/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
index 5f2dc4f..af8e786 100644
--- a/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
+++ b/components/camel-cache/src/test/java/org/apache/camel/component/cache/DefaultCacheManagerFactoryTest.java
@@ -60,7 +60,7 @@ public class DefaultCacheManagerFactoryTest extends Assert {
@Test
public void testNoProvidedConfiguration() throws Exception {
- CacheManagerFactory factory = new DefaultCacheManagerFactory(getClass().getResourceAsStream("/ehcache.xml"));
+ CacheManagerFactory factory = new DefaultCacheManagerFactory(getClass().getResourceAsStream("/ehcache.xml"), "/ehcache.xml");
CacheManager manager = factory.getInstance();
// CAMEL-7195
assertThat("There should be no peer providers configured", manager.getCacheManagerPeerProviders().size(), is(0));
@@ -69,7 +69,7 @@ public class DefaultCacheManagerFactoryTest extends Assert {
@Test
public void testFailSafeEHCacheManager() throws Exception {
- CacheManagerFactory factory1 = new DefaultCacheManagerFactory(null);
+ CacheManagerFactory factory1 = new DefaultCacheManagerFactory(null, null);
CacheManagerFactory factory2 = new DefaultCacheManagerFactory();
assertSame("The cache managers should be the same, loaded from fallback ehcache config",
factory1.getInstance(), factory2.getInstance());