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 E32F2200B9D for ; Wed, 28 Sep 2016 10:20:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E2051160AD4; Wed, 28 Sep 2016 08:20:51 +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 28F22160AB4 for ; Wed, 28 Sep 2016 10:20:51 +0200 (CEST) Received: (qmail 92175 invoked by uid 500); 28 Sep 2016 08:20:45 -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 91657 invoked by uid 99); 28 Sep 2016 08:20:44 -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, 28 Sep 2016 08:20:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7A12EEEE1B; Wed, 28 Sep 2016 08:20:44 +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, 28 Sep 2016 08:20:53 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/50] [abbrv] flink git commit: [FLINK-4403] [rpc] Use relative classloader for proxies, rather than system class loader. archived-at: Wed, 28 Sep 2016 08:20:52 -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/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 Authored: Tue Aug 16 21:11:01 2016 +0200 Committer: Till Rohrmann 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);