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 2015/11/28 09:00:04 UTC
[1/4] camel git commit: CAMEL-9349: ResourceHelper - Allow to load
resource from registry
Repository: camel
Updated Branches:
refs/heads/master b93511e61 -> 17e222db0
CAMEL-9349: ResourceHelper - Allow to load resource from registry
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/14784c1f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/14784c1f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/14784c1f
Branch: refs/heads/master
Commit: 14784c1f4428b198dc28e1be2b92bc080bf6019c
Parents: b93511e
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Nov 27 19:50:39 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Nov 27 19:50:39 2015 +0100
----------------------------------------------------------------------
.../camel/component/ResourceEndpoint.java | 6 +--
.../component/language/LanguageProducer.java | 2 +-
.../validator/DefaultLSResourceResolver.java | 4 +-
.../component/validator/ValidatorEndpoint.java | 8 ++--
.../apache/camel/support/LanguageSupport.java | 2 +-
.../org/apache/camel/util/ResourceHelper.java | 39 +++++++++++++++++++-
.../xslt/XsltCustomizeURIResolverTest.java | 2 +-
.../apache/camel/util/ResourceHelperTest.java | 30 ++++++++++++---
8 files changed, 75 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/main/java/org/apache/camel/component/ResourceEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/ResourceEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/ResourceEndpoint.java
index a8e7169..f99441a 100644
--- a/camel-core/src/main/java/org/apache/camel/component/ResourceEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/ResourceEndpoint.java
@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
public abstract class ResourceEndpoint extends ProcessorEndpoint implements ManagedResourceEndpointMBean {
protected final Logger log = LoggerFactory.getLogger(getClass());
private volatile byte[] buffer;
- @UriPath(description = "Path to the resource") @Metadata(required = "true")
+ @UriPath(description = "Path to the resource, or a reference to lookup a bean in the Registry to use as the resource") @Metadata(required = "true")
private String resourceUri;
@UriParam(defaultValue = "false", description = "Sets whether to use resource content cache or not")
private boolean contentCache;
@@ -96,7 +96,7 @@ public abstract class ResourceEndpoint extends ProcessorEndpoint implements Mana
* @throws IOException is thrown if resource is not found or cannot be loaded
*/
protected InputStream loadResource(String uri) throws IOException {
- return ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), uri);
+ return ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), uri);
}
@ManagedAttribute(description = "Whether the resource is cached")
@@ -141,7 +141,7 @@ public abstract class ResourceEndpoint extends ProcessorEndpoint implements Mana
}
/**
- * Path to the resource
+ * Path to the resource, or a reference to lookup a bean in the Registry to use as the resource
*
* @param resourceUri the resource path
*/
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java b/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java
index 7b5c73c..40cdab2 100644
--- a/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/language/LanguageProducer.java
@@ -72,7 +72,7 @@ public class LanguageProducer extends DefaultProducer {
if (script == null) {
is = getEndpoint().getResourceAsInputStream();
} else if (ResourceHelper.hasScheme(script)) {
- is = ResourceHelper.resolveMandatoryResourceAsInputStream(getEndpoint().getCamelContext().getClassResolver(), script);
+ is = ResourceHelper.resolveMandatoryResourceAsInputStream(getEndpoint().getCamelContext(), script);
}
if (is != null && !getEndpoint().isBinary()) {
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java b/camel-core/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
index 38fa704..2de0a9e 100644
--- a/camel-core/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
+++ b/camel-core/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
@@ -105,7 +105,7 @@ public class DefaultLSResourceResolver implements LSResourceResolver {
// find the xsd with relative path
if (ObjectHelper.isNotEmpty(relatedURI)) {
try {
- ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext.getClassResolver(), relatedURI);
+ ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, relatedURI);
return relatedURI;
} catch (IOException e) {
// ignore the exception
@@ -128,7 +128,7 @@ public class DefaultLSResourceResolver implements LSResourceResolver {
@Override
public InputStream getByteStream() {
try {
- return ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext.getClassResolver(), uri);
+ return ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, uri);
} catch (IOException e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java
index 9bbeafd..3eb3fd3 100644
--- a/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorEndpoint.java
@@ -45,7 +45,8 @@ public class ValidatorEndpoint extends DefaultEndpoint {
private static final Logger LOG = LoggerFactory.getLogger(ValidatorEndpoint.class);
- @UriPath(description = "URL to a local resource on the classpath or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.")
+ @UriPath(description = "URL to a local resource on the classpath, or a reference to lookup a bean in the Registry,"
+ + " or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.")
@Metadata(required = "true")
private String resourceUri;
@UriParam(defaultValue = XMLConstants.W3C_XML_SCHEMA_NS_URI, label = "advanced",
@@ -81,7 +82,7 @@ public class ValidatorEndpoint extends DefaultEndpoint {
public Producer createProducer() throws Exception {
ValidatingProcessor validator = new ValidatingProcessor();
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), resourceUri);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), resourceUri);
byte[] bytes = null;
try {
bytes = IOConverter.toBytes(is);
@@ -132,7 +133,8 @@ public class ValidatorEndpoint extends DefaultEndpoint {
}
/**
- * URL to a local resource on the classpath or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.
+ * URL to a local resource on the classpath,or a reference to lookup a bean in the Registry,
+ * or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.
*/
public void setResourceUri(String resourceUri) {
this.resourceUri = resourceUri;
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/main/java/org/apache/camel/support/LanguageSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/support/LanguageSupport.java b/camel-core/src/main/java/org/apache/camel/support/LanguageSupport.java
index fed9521..2fc52f9 100644
--- a/camel-core/src/main/java/org/apache/camel/support/LanguageSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/support/LanguageSupport.java
@@ -64,7 +64,7 @@ public abstract class LanguageSupport implements Language, IsSingleton, CamelCon
String uri = expression.substring(RESOURCE.length());
InputStream is = null;
try {
- is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext.getClassResolver(), uri);
+ is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, uri);
expression = camelContext.getTypeConverter().mandatoryConvertTo(String.class, is);
} catch (Exception e) {
throw new ExpressionIllegalSyntaxException(expression, e);
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java b/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java
index 0cb50ef..cea7c38 100644
--- a/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.util;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -74,7 +75,7 @@ public final class ResourceHelper {
if (hasScheme(external)) {
InputStream is = null;
try {
- is = resolveMandatoryResourceAsInputStream(camelContext.getClassResolver(), external);
+ is = resolveMandatoryResourceAsInputStream(camelContext, external);
expression = camelContext.getTypeConverter().convertTo(String.class, is);
} catch (IOException e) {
throw new RuntimeCamelException("Cannot load resource " + external, e);
@@ -118,13 +119,49 @@ public final class ResourceHelper {
/**
* Resolves the mandatory resource.
* <p/>
+ * The resource uri can refer to the following systems to be loaded from
+ * <ul>
+ * <il>file:nameOfFile - to refer to the file system</il>
+ * <il>classpath:nameOfFile - to refer to the classpath (default)</il>
+ * <il>http:uri - to load the resoufce using HTTP</il>
+ * <il>ref:nameOfBean - to lookup the resource in the {@link org.apache.camel.spi.Registry}</il>
+ * </ul>
+ * If no prefix has been given, then the resource is loaded from the classpath
+ * <p/>
+ * If possible recommended to use {@link #resolveMandatoryResourceAsUrl(org.apache.camel.spi.ClassResolver, String)}
+ *
+ * @param camelContext the Camel Context
+ * @param uri URI of the resource
+ * @return the resource as an {@link InputStream}. Remember to close this stream after usage.
+ * @throws java.io.IOException is thrown if the resource file could not be found or loaded as {@link InputStream}
+ */
+ public static InputStream resolveMandatoryResourceAsInputStream(CamelContext camelContext, String uri) throws IOException {
+ if (uri.startsWith("ref:")) {
+ String ref = uri.substring(4);
+ String value = CamelContextHelper.mandatoryLookup(camelContext, ref, String.class);
+ return new ByteArrayInputStream(value.getBytes());
+ }
+ InputStream is = resolveResourceAsInputStream(camelContext.getClassResolver(), uri);
+ if (is == null) {
+ String resolvedName = resolveUriPath(uri);
+ throw new FileNotFoundException("Cannot find resource: " + resolvedName + " in classpath for URI: " + uri);
+ } else {
+ return is;
+ }
+ }
+
+ /**
+ * Resolves the mandatory resource.
+ * <p/>
* If possible recommended to use {@link #resolveMandatoryResourceAsUrl(org.apache.camel.spi.ClassResolver, String)}
*
* @param classResolver the class resolver to load the resource from the classpath
* @param uri URI of the resource
* @return the resource as an {@link InputStream}. Remember to close this stream after usage.
* @throws java.io.IOException is thrown if the resource file could not be found or loaded as {@link InputStream}
+ * @deprecated use {@link #resolveMandatoryResourceAsInputStream(CamelContext, String)}
*/
+ @Deprecated
public static InputStream resolveMandatoryResourceAsInputStream(ClassResolver classResolver, String uri) throws IOException {
InputStream is = resolveResourceAsInputStream(classResolver, uri);
if (is == null) {
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/test/java/org/apache/camel/component/xslt/XsltCustomizeURIResolverTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/xslt/XsltCustomizeURIResolverTest.java b/camel-core/src/test/java/org/apache/camel/component/xslt/XsltCustomizeURIResolverTest.java
index 37bf103..959de9d 100644
--- a/camel-core/src/test/java/org/apache/camel/component/xslt/XsltCustomizeURIResolverTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/xslt/XsltCustomizeURIResolverTest.java
@@ -64,7 +64,7 @@ public class XsltCustomizeURIResolverTest extends ContextTestSupport {
public Source resolve(String href, String base) throws TransformerException {
if (href.equals("org/apache/camel/component/xslt/include_not_existing_resource.xsl")) {
try {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), href);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, href);
return new StreamSource(is);
} catch (Exception e) {
throw new TransformerException(e);
http://git-wip-us.apache.org/repos/asf/camel/blob/14784c1f/camel-core/src/test/java/org/apache/camel/util/ResourceHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/ResourceHelperTest.java b/camel-core/src/test/java/org/apache/camel/util/ResourceHelperTest.java
index 145c747..f654aa6 100644
--- a/camel-core/src/test/java/org/apache/camel/util/ResourceHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/ResourceHelperTest.java
@@ -26,6 +26,7 @@ import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.TestSupport;
import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.SimpleRegistry;
/**
*
@@ -36,7 +37,7 @@ public class ResourceHelperTest extends TestSupport {
CamelContext context = new DefaultCamelContext();
context.start();
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), "file:src/test/resources/log4j.properties");
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, "file:src/test/resources/log4j.properties");
assertNotNull(is);
String text = context.getTypeConverter().convertTo(String.class, is);
@@ -54,7 +55,7 @@ public class ResourceHelperTest extends TestSupport {
createDirectory("target/my space");
FileUtil.copyFile(new File("src/test/resources/log4j.properties"), new File("target/my space/log4j.properties"));
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), "file:target/my%20space/log4j.properties");
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, "file:target/my%20space/log4j.properties");
assertNotNull(is);
String text = context.getTypeConverter().convertTo(String.class, is);
@@ -69,7 +70,7 @@ public class ResourceHelperTest extends TestSupport {
CamelContext context = new DefaultCamelContext();
context.start();
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), "classpath:log4j.properties");
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, "classpath:log4j.properties");
assertNotNull(is);
String text = context.getTypeConverter().convertTo(String.class, is);
@@ -80,11 +81,28 @@ public class ResourceHelperTest extends TestSupport {
context.stop();
}
+ public void testLoadRegistry() throws Exception {
+ SimpleRegistry registry = new SimpleRegistry();
+ registry.put("myBean", "This is a log4j logging configuation file");
+
+ CamelContext context = new DefaultCamelContext(registry);
+ context.start();
+
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, "ref:myBean");
+ assertNotNull(is);
+
+ String text = context.getTypeConverter().convertTo(String.class, is);
+ assertNotNull(text);
+ assertTrue(text.contains("log4j"));
+ is.close();
+
+ context.stop();
+ }
public void testLoadClasspathDefault() throws Exception {
CamelContext context = new DefaultCamelContext();
context.start();
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), "log4j.properties");
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, "log4j.properties");
assertNotNull(is);
String text = context.getTypeConverter().convertTo(String.class, is);
@@ -100,7 +118,7 @@ public class ResourceHelperTest extends TestSupport {
context.start();
try {
- ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), "file:src/test/resources/notfound.txt");
+ ResourceHelper.resolveMandatoryResourceAsInputStream(context, "file:src/test/resources/notfound.txt");
fail("Should not find file");
} catch (FileNotFoundException e) {
assertTrue(e.getMessage().contains("notfound.txt"));
@@ -114,7 +132,7 @@ public class ResourceHelperTest extends TestSupport {
context.start();
try {
- ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), "classpath:notfound.txt");
+ ResourceHelper.resolveMandatoryResourceAsInputStream(context, "classpath:notfound.txt");
fail("Should not find file");
} catch (FileNotFoundException e) {
assertEquals("Cannot find resource: classpath:notfound.txt in classpath for URI: classpath:notfound.txt", e.getMessage());
[2/4] camel git commit: CAMEL-9349: ResourceHelper - Allow to load
resource from registry
Posted by da...@apache.org.
CAMEL-9349: ResourceHelper - Allow to load resource from registry
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0f7b73aa
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0f7b73aa
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0f7b73aa
Branch: refs/heads/master
Commit: 0f7b73aaae579c4f2757c795a9d397d6ab59984f
Parents: 14784c1
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Nov 28 08:18:46 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Nov 28 08:18:46 2015 +0100
----------------------------------------------------------------------
.../camel/component/apns/factory/ApnsServiceFactory.java | 2 +-
.../org/apache/camel/dataformat/beanio/BeanIODataFormat.java | 2 +-
.../org/apache/camel/component/cache/CacheComponent.java | 2 +-
.../org/apache/camel/converter/crypto/PGPDataFormatUtil.java | 2 +-
.../java/org/apache/camel/component/dozer/DozerEndpoint.java | 2 +-
.../org/apache/camel/component/dozer/ExpressionMapper.java | 2 +-
.../apache/camel/component/flatpack/FlatpackEndpoint.java | 4 ++--
.../apache/camel/dataformat/flatpack/FlatpackDataFormat.java | 8 ++++----
.../java/org/apache/camel/component/fop/FopEndpoint.java | 2 +-
.../apache/camel/component/file/remote/SftpOperations.java | 4 ++--
.../org/apache/camel/component/gae/auth/GAuthJksLoader.java | 2 +-
.../org/apache/camel/component/gae/auth/GAuthPk8Loader.java | 2 +-
.../org/apache/camel/component/ibatis/IBatisComponent.java | 2 +-
.../apache/camel/component/validator/jing/JingEndpoint.java | 2 +-
.../org/apache/camel/component/jolt/JoltFirstSampleTest.java | 6 ++----
.../org/apache/camel/component/mybatis/MyBatisComponent.java | 2 +-
.../org/apache/camel/component/quartz/QuartzComponent.java | 2 +-
.../org/apache/camel/component/quartz2/QuartzComponent.java | 2 +-
.../camel/component/schematron/SchematronEndpoint.java | 2 +-
.../servletlistener/CamelServletContextListener.java | 2 +-
.../apache/camel/component/velocity/VelocityEndpoint.java | 2 +-
21 files changed, 27 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-apns/src/main/java/org/apache/camel/component/apns/factory/ApnsServiceFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-apns/src/main/java/org/apache/camel/component/apns/factory/ApnsServiceFactory.java b/components/camel-apns/src/main/java/org/apache/camel/component/apns/factory/ApnsServiceFactory.java
index 0557d2c..9f917da 100644
--- a/components/camel-apns/src/main/java/org/apache/camel/component/apns/factory/ApnsServiceFactory.java
+++ b/components/camel-apns/src/main/java/org/apache/camel/component/apns/factory/ApnsServiceFactory.java
@@ -202,7 +202,7 @@ public class ApnsServiceFactory implements CamelContextAware {
InputStream certificateInputStream = null;
try {
- certificateInputStream = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext.getClassResolver(), getCertificatePath());
+ certificateInputStream = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, getCertificatePath());
builder.withCert(certificateInputStream, getCertificatePassword());
} finally {
ResourceUtils.close(certificateInputStream);
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java b/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
index fb2ed4c..5af26f7 100644
--- a/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
+++ b/components/camel-beanio/src/main/java/org/apache/camel/dataformat/beanio/BeanIODataFormat.java
@@ -87,7 +87,7 @@ public class BeanIODataFormat extends ServiceSupport implements DataFormat, Data
factory = StreamFactory.newInstance();
// Load the mapping file using the resource helper to ensure it can be loaded in OSGi and other environments
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), mapping);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), mapping);
try {
if (properties != null) {
factory.load(is, properties);
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/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 e15ba85..59aceac 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
@@ -102,7 +102,7 @@ public class CacheComponent extends UriEndpointComponent {
super.doStart();
if (cacheManagerFactory == null) {
if (configurationFile != null) {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), configurationFile);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), configurationFile);
cacheManagerFactory = new DefaultCacheManagerFactory(is, configurationFile);
} else {
cacheManagerFactory = new DefaultCacheManagerFactory();
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormatUtil.java
----------------------------------------------------------------------
diff --git a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormatUtil.java b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormatUtil.java
index 6f8f815..a46156e 100644
--- a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormatUtil.java
+++ b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormatUtil.java
@@ -185,7 +185,7 @@ public final class PGPDataFormatUtil {
if (keyRing != null) {
is = new ByteArrayInputStream(keyRing);
} else {
- is = ResourceHelper.resolveMandatoryResourceAsInputStream(context.getClassResolver(), filename);
+ is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, filename);
}
return is;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
index 02e1775..eae218c 100644
--- a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
+++ b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/DozerEndpoint.java
@@ -126,7 +126,7 @@ public class DozerEndpoint extends DefaultEndpoint {
try {
LOG.info("Loading Dozer mapping file {}.", configuration.getMappingFile());
// create the mapper instance and add the mapping file
- mapStream = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), configuration.getMappingFile());
+ mapStream = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), configuration.getMappingFile());
answer.addMapping(mapStream);
} finally {
IOHelper.close(mapStream);
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java
----------------------------------------------------------------------
diff --git a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java
index 9a6ec17..77e54ae 100644
--- a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java
+++ b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java
@@ -98,7 +98,7 @@ public class ExpressionMapper extends BaseConverter {
* @throws IOException is thrown if resource is not found or cannot be loaded
*/
protected InputStream loadResource(String uri) throws IOException {
- return ResourceHelper.resolveMandatoryResourceAsInputStream(currentExchange.get().getContext().getClassResolver(), uri);
+ return ResourceHelper.resolveMandatoryResourceAsInputStream(currentExchange.get().getContext(), uri);
}
/**
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java b/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java
index e6c9111..8c5cabe 100644
--- a/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java
+++ b/components/camel-flatpack/src/main/java/org/apache/camel/component/flatpack/FlatpackEndpoint.java
@@ -118,7 +118,7 @@ public class FlatpackEndpoint extends DefaultPollingEndpoint {
}
protected Parser createFixedParser(String resourceUri, Reader bodyReader) throws IOException {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), resourceUri);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), resourceUri);
InputStreamReader reader = new InputStreamReader(is);
Parser parser = getParserFactory().newFixedLengthParser(reader, bodyReader);
if (isAllowShortLines()) {
@@ -139,7 +139,7 @@ public class FlatpackEndpoint extends DefaultPollingEndpoint {
if (ObjectHelper.isEmpty(getResourceUri())) {
parser = getParserFactory().newDelimitedParser(bodyReader, delimiter, textQualifier);
} else {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), resourceUri);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), resourceUri);
InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
parser = getParserFactory().newDelimitedParser(reader, bodyReader, delimiter, textQualifier, ignoreFirstRecord);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-flatpack/src/main/java/org/apache/camel/dataformat/flatpack/FlatpackDataFormat.java
----------------------------------------------------------------------
diff --git a/components/camel-flatpack/src/main/java/org/apache/camel/dataformat/flatpack/FlatpackDataFormat.java b/components/camel-flatpack/src/main/java/org/apache/camel/dataformat/flatpack/FlatpackDataFormat.java
index 941f819..281d9f2 100644
--- a/components/camel-flatpack/src/main/java/org/apache/camel/dataformat/flatpack/FlatpackDataFormat.java
+++ b/components/camel-flatpack/src/main/java/org/apache/camel/dataformat/flatpack/FlatpackDataFormat.java
@@ -206,7 +206,7 @@ public class FlatpackDataFormat extends ServiceSupport implements DataFormat, Da
protected Parser createParser(Exchange exchange, Reader bodyReader) throws IOException {
if (isFixed()) {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext(), getDefinition());
InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
Parser parser = getParserFactory().newFixedLengthParser(reader, bodyReader);
if (allowShortLines) {
@@ -222,7 +222,7 @@ public class FlatpackDataFormat extends ServiceSupport implements DataFormat, Da
if (ObjectHelper.isEmpty(getDefinition())) {
return getParserFactory().newDelimitedParser(bodyReader, delimiter, textQualifier);
} else {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext(), getDefinition());
InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
Parser parser = getParserFactory().newDelimitedParser(reader, bodyReader, delimiter, textQualifier, ignoreFirstRecord);
if (allowShortLines) {
@@ -240,7 +240,7 @@ public class FlatpackDataFormat extends ServiceSupport implements DataFormat, Da
private Writer createWriter(Exchange exchange, Map<String, Object> firstRow, OutputStream stream) throws JDOMException, IOException {
if (isFixed()) {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext(), getDefinition());
InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
FixedWriterFactory factory = new FixedWriterFactory(reader);
return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
@@ -253,7 +253,7 @@ public class FlatpackDataFormat extends ServiceSupport implements DataFormat, Da
}
return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
} else {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext().getClassResolver(), getDefinition());
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(exchange.getContext(), getDefinition());
InputStreamReader reader = new InputStreamReader(is, IOHelper.getCharsetName(exchange));
DelimiterWriterFactory factory = new DelimiterWriterFactory(reader, delimiter, textQualifier);
return factory.createWriter(new OutputStreamWriter(stream, IOHelper.getCharsetName(exchange)));
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java b/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
index 8826f02..2cffd26 100644
--- a/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
+++ b/components/camel-fop/src/main/java/org/apache/camel/component/fop/FopEndpoint.java
@@ -109,7 +109,7 @@ public class FopEndpoint extends DefaultEndpoint {
}
if (userConfigURL != null) {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), userConfigURL);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), userConfigURL);
updateConfigurations(is, fopFactory);
}
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index ab7e649..bd25fb0 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -211,7 +211,7 @@ public class SftpOperations implements RemoteFileOperations<ChannelSftp.LsEntry>
}
}
try {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(endpoint.getCamelContext().getClassResolver(), sftpConfig.getPrivateKeyUri());
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(endpoint.getCamelContext(), sftpConfig.getPrivateKeyUri());
ByteArrayOutputStream bos = new ByteArrayOutputStream();
IOHelper.copyAndCloseInput(is, bos);
jsch.addIdentity("ID", bos.toByteArray(), null, passphrase);
@@ -244,7 +244,7 @@ public class SftpOperations implements RemoteFileOperations<ChannelSftp.LsEntry>
if (isNotEmpty(sftpConfig.getKnownHostsUri())) {
LOG.debug("Using knownhosts uri: {}", sftpConfig.getKnownHostsUri());
try {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(endpoint.getCamelContext().getClassResolver(), sftpConfig.getKnownHostsUri());
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(endpoint.getCamelContext(), sftpConfig.getKnownHostsUri());
jsch.setKnownHosts(is);
} catch (IOException e) {
throw new JSchException("Cannot read resource: " + sftpConfig.getKnownHostsUri(), e);
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthJksLoader.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthJksLoader.java b/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthJksLoader.java
index 1c7b0a7..8531bf0 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthJksLoader.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthJksLoader.java
@@ -88,7 +88,7 @@ public class GAuthJksLoader implements GAuthKeyLoader {
* Loads a private key from a Java keystore depending on this loader's properties.
*/
public PrivateKey loadPrivateKey() throws Exception {
- InputStream input = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), keyStoreLocation);
+ InputStream input = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), keyStoreLocation);
try {
return loadPrivateKey(input);
} finally {
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthPk8Loader.java
----------------------------------------------------------------------
diff --git a/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthPk8Loader.java b/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthPk8Loader.java
index 05da8e3..4068189 100644
--- a/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthPk8Loader.java
+++ b/components/camel-gae/src/main/java/org/apache/camel/component/gae/auth/GAuthPk8Loader.java
@@ -56,7 +56,7 @@ public class GAuthPk8Loader implements GAuthKeyLoader {
* Loads a private key from a PKCS#8 file.
*/
public PrivateKey loadPrivateKey() throws Exception {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), keyLocation);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), keyLocation);
String str;
try {
str = getCamelContext().getTypeConverter().mandatoryConvertTo(String.class, is);
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java b/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java
index 157ecbc..378cba0 100644
--- a/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java
+++ b/components/camel-ibatis/src/main/java/org/apache/camel/component/ibatis/IBatisComponent.java
@@ -81,7 +81,7 @@ public class IBatisComponent extends UriEndpointComponent {
}
protected SqlMapClient createSqlMapClient() throws IOException {
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), sqlMapConfig);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), sqlMapConfig);
return SqlMapClientBuilder.buildSqlMapClient(is);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-jing/src/main/java/org/apache/camel/component/validator/jing/JingEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-jing/src/main/java/org/apache/camel/component/validator/jing/JingEndpoint.java b/components/camel-jing/src/main/java/org/apache/camel/component/validator/jing/JingEndpoint.java
index 513c415..56eb0d8 100644
--- a/components/camel-jing/src/main/java/org/apache/camel/component/validator/jing/JingEndpoint.java
+++ b/components/camel-jing/src/main/java/org/apache/camel/component/validator/jing/JingEndpoint.java
@@ -124,7 +124,7 @@ public class JingEndpoint extends DefaultEndpoint {
if (inputSource == null) {
ObjectHelper.notEmpty(resourceUri, "resourceUri", this);
- InputStream inputStream = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), resourceUri);
+ InputStream inputStream = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), resourceUri);
inputSource = new InputSource(inputStream);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-jolt/src/test/java/org/apache/camel/component/jolt/JoltFirstSampleTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jolt/src/test/java/org/apache/camel/component/jolt/JoltFirstSampleTest.java b/components/camel-jolt/src/test/java/org/apache/camel/component/jolt/JoltFirstSampleTest.java
index 325aacd..a70cc5b 100644
--- a/components/camel-jolt/src/test/java/org/apache/camel/component/jolt/JoltFirstSampleTest.java
+++ b/components/camel-jolt/src/test/java/org/apache/camel/component/jolt/JoltFirstSampleTest.java
@@ -33,15 +33,13 @@ public class JoltFirstSampleTest extends CamelTestSupport {
getMockEndpoint("mock:result").expectedBodiesReceived(
IOHelper.loadText(
ResourceHelper.resolveMandatoryResourceAsInputStream(
- context.getClassResolver() ,
- "org/apache/camel/component/jolt/firstSample/output.json")
+ context, "org/apache/camel/component/jolt/firstSample/output.json")
).trim() // Remove the last newline added by IOHelper.loadText()
);
sendBody("direct://start",
ResourceHelper.resolveMandatoryResourceAsInputStream(
- context.getClassResolver(),
- "org/apache/camel/component/jolt/firstSample/input.json"));
+ context, "org/apache/camel/component/jolt/firstSample/input.json"));
assertMockEndpointsSatisfied();
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
index d0f260c..fa9ec7f 100644
--- a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
+++ b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
@@ -49,7 +49,7 @@ public class MyBatisComponent extends UriEndpointComponent {
protected SqlSessionFactory createSqlSessionFactory() throws IOException {
ObjectHelper.notNull(configurationUri, "configurationUri", this);
- InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), configurationUri);
+ InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), configurationUri);
try {
return new SqlSessionFactoryBuilder().build(is);
} finally {
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 5aad713..5bcea28 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -488,7 +488,7 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList
LOG.info("Loading Quartz properties file from: {}", getPropertiesFile());
InputStream is = null;
try {
- is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), getPropertiesFile());
+ is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), getPropertiesFile());
answer = new Properties();
answer.load(is);
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index 33dea2a..993166c 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -258,7 +258,7 @@ public class QuartzComponent extends UriEndpointComponent implements StartupList
LOG.info("Loading Quartz properties file from: {}", getPropertiesFile());
InputStream is = null;
try {
- is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), getPropertiesFile());
+ is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), getPropertiesFile());
answer = new Properties();
answer.load(is);
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronEndpoint.java b/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronEndpoint.java
index bc63b8e..35a9868 100644
--- a/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronEndpoint.java
+++ b/components/camel-schematron/src/main/java/org/apache/camel/component/schematron/SchematronEndpoint.java
@@ -127,7 +127,7 @@ public class SchematronEndpoint extends DefaultEndpoint {
try {
// Attempt to read the schematron rules from the class path first.
LOG.debug("Reading schematron rules from class path {}", path);
- InputStream schRules = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), path);
+ InputStream schRules = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), path);
rules = TemplatesFactory.newInstance().getTemplates(schRules, transformerFactory);
} catch (Exception e) {
// Attempts from the file system.
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-servletlistener/src/main/java/org/apache/camel/component/servletlistener/CamelServletContextListener.java
----------------------------------------------------------------------
diff --git a/components/camel-servletlistener/src/main/java/org/apache/camel/component/servletlistener/CamelServletContextListener.java b/components/camel-servletlistener/src/main/java/org/apache/camel/component/servletlistener/CamelServletContextListener.java
index cb99d9f..0e53b07 100644
--- a/components/camel-servletlistener/src/main/java/org/apache/camel/component/servletlistener/CamelServletContextListener.java
+++ b/components/camel-servletlistener/src/main/java/org/apache/camel/component/servletlistener/CamelServletContextListener.java
@@ -417,7 +417,7 @@ public abstract class CamelServletContextListener<R extends Registry> implements
// XML resource from classpath or file system
InputStream is = null;
try {
- is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext.getClassResolver(), value);
+ is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, value);
target = camelContext.loadRoutesDefinition(is);
} catch (Exception e) {
throw new RuntimeException("Error loading routes from resource: " + value, e);
http://git-wip-us.apache.org/repos/asf/camel/blob/0f7b73aa/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
index d36da1f..c36c7d1 100644
--- a/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
+++ b/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
@@ -92,7 +92,7 @@ public class VelocityEndpoint extends ResourceEndpoint {
// load the velocity properties from property file which may overrides the default ones
if (ObjectHelper.isNotEmpty(getPropertiesFile())) {
- InputStream reader = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), getPropertiesFile());
+ InputStream reader = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), getPropertiesFile());
try {
properties.load(reader);
log.info("Loaded the velocity configuration file " + getPropertiesFile());
[4/4] camel git commit: Polished and added needed method after a
change in camel-spring-boot
Posted by da...@apache.org.
Polished and added needed method after a change in camel-spring-boot
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/17e222db
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/17e222db
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/17e222db
Branch: refs/heads/master
Commit: 17e222db0912b7c119133c2be26875f546ec9f57
Parents: 51cf54f
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Nov 28 08:56:28 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Nov 28 08:56:28 2015 +0100
----------------------------------------------------------------------
.../example/springboot/metrics/Application.java | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/17e222db/examples/camel-example-spring-boot-metrics/src/main/java/org/apache/camel/example/springboot/metrics/Application.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot-metrics/src/main/java/org/apache/camel/example/springboot/metrics/Application.java b/examples/camel-example-spring-boot-metrics/src/main/java/org/apache/camel/example/springboot/metrics/Application.java
index 9873a54..bbeb2fd 100644
--- a/examples/camel-example-spring-boot-metrics/src/main/java/org/apache/camel/example/springboot/metrics/Application.java
+++ b/examples/camel-example-spring-boot-metrics/src/main/java/org/apache/camel/example/springboot/metrics/Application.java
@@ -53,9 +53,8 @@ public class Application {
* @param args no command line args required
*/
public static void main(String[] args) {
- LOG.info(" *** STARTING CAMEL METRICS EXAMPLE APPLICATION ***");
+ LOG.info(" *** Starting Camel Metrics Example Application ***");
SpringApplication.run(Application.class, args);
-
}
/**
@@ -79,10 +78,9 @@ public class Application {
@Bean
public RouteBuilder slowRoute() {
return new RouteBuilder() {
-
@Override
public void configure() throws Exception {
- from("timer://foo?period=6000&daemon=false").routeId("slow-route").setBody().constant("Slow hello world!").log("${body}");
+ from("timer://foo?period=6000").routeId("slow-route").setBody().constant("Slow hello world!").log("${body}");
}
};
}
@@ -93,10 +91,9 @@ public class Application {
@Bean
public RouteBuilder fastRoute() {
return new RouteBuilder() {
-
@Override
public void configure() throws Exception {
- from("timer://foo?period=2000&daemon=false").routeId("fast-route").setBody().constant("Fast hello world!").log("${body}");
+ from("timer://foo?period=2000").routeId("fast-route").setBody().constant("Fast hello world!").log("${body}");
}
};
}
@@ -104,14 +101,18 @@ public class Application {
@Bean
CamelContextConfiguration contextConfiguration() {
return new CamelContextConfiguration() {
-
@Override
public void beforeApplicationStart(CamelContext context) {
- LOG.info("Configuring camel metrics on all routes");
+ LOG.info("Configuring Camel metrics on all routes");
MetricsRoutePolicyFactory fac = new MetricsRoutePolicyFactory();
fac.setMetricsRegistry(metricRegistry);
context.addRoutePolicyFactory(fac);
}
+
+ @Override
+ public void afterApplicationStart(CamelContext camelContext) {
+ // noop
+ }
};
}
[3/4] camel git commit: Downgrade easymock as some JARs in 3.4 is no
longer there, so camel-cxf cannot build.
Posted by da...@apache.org.
Downgrade easymock as some JARs in 3.4 is no longer there, so camel-cxf cannot build.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/51cf54f3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/51cf54f3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/51cf54f3
Branch: refs/heads/master
Commit: 51cf54f3cd512745e25e5eac9ecd75d17b4d0372
Parents: 0f7b73a
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Nov 28 08:19:06 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Nov 28 08:19:06 2015 +0100
----------------------------------------------------------------------
parent/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/51cf54f3/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index b29bf7c..02525cd 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -138,7 +138,7 @@
<dozer-version>5.5.1</dozer-version>
<drools-version>6.3.0.Final</drools-version>
<dropbox-version>1.8.2</dropbox-version>
- <easymock-version>3.4</easymock-version>
+ <easymock-version>3.2</easymock-version>
<eclipse-compiler-version>4.2.2</eclipse-compiler-version>
<eclipse-equinox-common-version>3.3.0-v20070426</eclipse-equinox-common-version>
<ehcache-version>2.10.1</ehcache-version>