Return-Path: X-Original-To: apmail-river-dev-archive@www.apache.org Delivered-To: apmail-river-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50F5210EA6 for ; Mon, 3 Mar 2014 06:09:23 +0000 (UTC) Received: (qmail 50288 invoked by uid 500); 3 Mar 2014 06:09:23 -0000 Delivered-To: apmail-river-dev-archive@river.apache.org Received: (qmail 50152 invoked by uid 500); 3 Mar 2014 06:09:19 -0000 Mailing-List: contact dev-help@river.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@river.apache.org Delivered-To: mailing list dev@river.apache.org Received: (qmail 50144 invoked by uid 99); 3 Mar 2014 06:09:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 06:09:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.128.176] (HELO mail-ve0-f176.google.com) (209.85.128.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 06:09:11 +0000 Received: by mail-ve0-f176.google.com with SMTP id cz12so3141131veb.7 for ; Sun, 02 Mar 2014 22:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xpro.biz; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=I+mX0GY0nBfQnGbIbrWfBtxGkCMn1bzy0W9u4FcidqQ=; b=KzCIIONSFvV/co1IAIAtfoEJgds3o2MsPpNvCqTG0Nh/NSwMjBWGlNOFtSnr1dFFdT 9+PVu6lzXj+YStwkU/eZNnzYoS4TMb/V980nebdoI1ul36elqVT/OzzpQq+ZpLiwLMBc nQxqbAGU0gM+cBAbuxv22ic1jwqDJtnj+KHQk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=I+mX0GY0nBfQnGbIbrWfBtxGkCMn1bzy0W9u4FcidqQ=; b=ahIVPM90dAL0GiDk5aBtE1MYrDQrNPMZAaQWZwdhGhYIb+exjWUVHXDMeJovJels0v IZpI0acesWYUQkRed+B/NSjqTih4kENkuXVP2RI31X3VdaKVd6FWFaCBYZlxlLTYsid4 p1sJCY1yP6b1vsELBfPBQBaougb97+Lqs1nBwi8MrfvYrphnGTuGCpk5e/pT4HjSEKUD oZrGoLPl+/kub+gvZ4KDzK5bdn5sODKjOGq3di/NYNu2IUAeS7WDhOUseqhhoK07xVeN 4KynTDbxqsQYpiVVyFHojHd+1wp5CjzZnHzeRz+vB4IuFB4n9lhcSeCmH4YYb5WvTtvK oT9A== X-Gm-Message-State: ALoCoQmEQuXVH5oP2OubQ7BIfVfVzrQje3lk1hUMpYwTLV4bCg4dF9vury6U2cRl7fiI7YYQase/ MIME-Version: 1.0 X-Received: by 10.52.243.164 with SMTP id wz4mr24152841vdc.31.1393826930158; Sun, 02 Mar 2014 22:08:50 -0800 (PST) Received: by 10.220.40.137 with HTTP; Sun, 2 Mar 2014 22:08:50 -0800 (PST) X-Originating-IP: [83.0.28.185] Received: by 10.220.40.137 with HTTP; Sun, 2 Mar 2014 22:08:50 -0800 (PST) In-Reply-To: <1393799620.1979.5.camel@Nokia-N900> References: <5313816B.9030703@xpro.biz> <1393799620.1979.5.camel@Nokia-N900> Date: Mon, 3 Mar 2014 07:08:50 +0100 Message-ID: Subject: Re: River-436 - need some explanation of preferred class provider From: =?UTF-8?B?TWljaGHFgiBLxYJlY3plaw==?= To: dev@river.apache.org Content-Type: multipart/alternative; boundary=001a11c1c3480d0ac704f3ad9fea X-Virus-Checked: Checked by ClamAV on apache.org --001a11c1c3480d0ac704f3ad9fea Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable But it will also be loaded by WrapperProxy ClassLoader, since it is preferred there. So it will end up with ClassCastException, right? Regards, Michal If Util is installed locally, it will only be loaded by the application ClassLoader, since it isn't preferred. Peter. ----- Original message ----- > Folks, > while woking on the River-436 patch proposal I've came across the > scenario that I am not sure how to handle: > > Utility service: > //inteface is NOT preferred > interface Util {...} > //class IS preferred > class UtilProxy implements Util {} > > Wrapper service: > //NOT preferred > interface Wrapper {} > //preferred > class WrapperProxy implements Serializable{ > //initialized with Util impl from a lookup service > private Util util; > } > > Wrapper service codebase includes Util interface but it is _preferred_. > > Would deserialization of WrapperProxy end with ClassCastException? > From what I understand UtilProxy is annotated with its codebase. When > deserializing UtilProxy a ClassLoader is going to be created with parent > set to TCCL. It means Util interface is going to be loaded twice by two > ClassLoaders - one for WrapperProxy codebase and another for UtilProxy > codebase. > > Am I correct? > And if so: is it desired behavior? > > Regards, > > -- > Micha=C5=82 K=C5=82eczek > XPro Quality Matters > http://www.xpro.biz > --001a11c1c3480d0ac704f3ad9fea--