You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/11/23 14:50:53 UTC
[camel] branch master updated: [CAMEL-12028] Flink requires
internals to be visible by TCCL
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new f2614d0 [CAMEL-12028] Flink requires internals to be visible by TCCL
f2614d0 is described below
commit f2614d027cacc4c77916c3db88d5e0aad0ddabcd
Author: Thomas Diesler <td...@redhat.com>
AuthorDate: Thu Nov 23 14:51:18 2017 +0100
[CAMEL-12028] Flink requires internals to be visible by TCCL
---
.../camel/component/flink/DataSetFlinkProducer.java | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/components/camel-flink/src/main/java/org/apache/camel/component/flink/DataSetFlinkProducer.java b/components/camel-flink/src/main/java/org/apache/camel/component/flink/DataSetFlinkProducer.java
index 054180d..e305157 100644
--- a/components/camel-flink/src/main/java/org/apache/camel/component/flink/DataSetFlinkProducer.java
+++ b/components/camel-flink/src/main/java/org/apache/camel/component/flink/DataSetFlinkProducer.java
@@ -35,13 +35,21 @@ public class DataSetFlinkProducer extends DefaultProducer {
Object body = exchange.getIn().getBody();
Object result;
- if (body instanceof List) {
- List list = (List) body;
- Object[] array = list.toArray(new Object[list.size()]);
- result = dataSetCallback.onDataSet(ds, array);
- } else {
- result = dataSetCallback.onDataSet(ds, body);
+
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(DataSet.class.getClassLoader());
+ if (body instanceof List) {
+ List list = (List) body;
+ Object[] array = list.toArray(new Object[list.size()]);
+ result = dataSetCallback.onDataSet(ds, array);
+ } else {
+ result = dataSetCallback.onDataSet(ds, body);
+ }
+ } finally {
+ Thread.currentThread().setContextClassLoader(tccl);
}
+
collectResults(exchange, result);
}
--
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].