Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 63E62200B96 for ; Wed, 21 Sep 2016 11:52:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 62CDD160AED; Wed, 21 Sep 2016 09:52:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7CD27160AF2 for ; Wed, 21 Sep 2016 11:52:36 +0200 (CEST) Received: (qmail 61936 invoked by uid 500); 21 Sep 2016 09:52:35 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 60961 invoked by uid 99); 21 Sep 2016 09:52:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Sep 2016 09:52:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E7D7BE0061; Wed, 21 Sep 2016 09:52:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: trohrmann@apache.org To: commits@flink.apache.org Date: Wed, 21 Sep 2016 09:52:58 -0000 Message-Id: In-Reply-To: <50011b84f8e94b19ac9845fd15a1fafe@git.apache.org> References: <50011b84f8e94b19ac9845fd15a1fafe@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [25/50] [abbrv] flink git commit: [FLINK-4403] [rpc] Use relative classloader for proxies, rather than system class loader. archived-at: Wed, 21 Sep 2016 09:52:37 -0000 [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/68998378 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/68998378 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/68998378 Branch: refs/heads/flip-6 Commit: 689983781c30db903b52d593b2fbfebba1ab6236 Parents: fe90811 Author: Stephan Ewen Authored: Tue Aug 16 21:11:01 2016 +0200 Committer: Till Rohrmann Committed: Wed Sep 21 11:39:14 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/68998378/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);