flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject [10/50] [abbrv] flink git commit: [FLINK-4403] [rpc] Use relative classloader for proxies, rather than system class loader.
Date Wed, 28 Sep 2016 08:20:53 GMT
[FLINK-4403] [rpc] Use relative classloader for proxies, rather than system class loader.


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

Branch: refs/heads/flip-6
Commit: b8dedf1d2e87991b4ca0d0d3d228a63cd048c8fb
Parents: 2738709
Author: Stephan Ewen <sewen@apache.org>
Authored: Tue Aug 16 21:11:01 2016 +0200
Committer: Till Rohrmann <trohrmann@apache.org>
Committed: Tue Sep 27 19:24:56 2016 +0200

----------------------------------------------------------------------
 .../org/apache/flink/runtime/rpc/akka/AkkaRpcService.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/b8dedf1d/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcService.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcService.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcService.java
index b647bbd..d987c2f 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcService.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcService.java
@@ -104,9 +104,14 @@ public class AkkaRpcService implements RpcService {
 
 				InvocationHandler akkaInvocationHandler = new AkkaInvocationHandler(actorRef, timeout,
maximumFramesize);
 
+				// Rather than using the System ClassLoader directly, we derive the ClassLoader
+				// from this class . That works better in cases where Flink runs embedded and all Flink
+				// code is loaded dynamically (for example from an OSGI bundle) through a custom ClassLoader
+				ClassLoader classLoader = AkkaRpcService.this.getClass().getClassLoader();
+				
 				@SuppressWarnings("unchecked")
 				C proxy = (C) Proxy.newProxyInstance(
-					ClassLoader.getSystemClassLoader(),
+					classLoader,
 					new Class<?>[] {clazz},
 					akkaInvocationHandler);
 


Mime
View raw message