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 5F7AD200C78 for ; Thu, 18 May 2017 10:58:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5C690160BC4; Thu, 18 May 2017 08:58: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 A0972160BB0 for ; Thu, 18 May 2017 10:58:36 +0200 (CEST) Received: (qmail 90320 invoked by uid 500); 18 May 2017 08:58:35 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 90302 invoked by uid 99); 18 May 2017 08:58:34 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 May 2017 08:58:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 41FB2CD864 for ; Thu, 18 May 2017 08:58:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.397 X-Spam-Level: X-Spam-Status: No, score=-2.397 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id HK4XSRtVUi9K for ; Thu, 18 May 2017 08:58:33 +0000 (UTC) Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E90C25F5A2 for ; Thu, 18 May 2017 08:58:32 +0000 (UTC) Received: by mail-wr0-f179.google.com with SMTP id l50so28537897wrc.3 for ; Thu, 18 May 2017 01:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=pX4vvzhqQpS3bc4F/W4I2SfMJijwGfbNVbpfQII7EvE=; b=UZfIhdAu8+U8EY4Y5gUhdBZ6cRKfEIwToi/DkyH9VTiR2J6lC4J85UnYp/EunQ0JIN wgF74lf9CjKvgPgsslSwRVlNzD885XN/sERHZQRFiLZ1k19yLxPK0vP4GhQP8NpZ5LMj Mg64sh1/eBxZBzue+HvTyLYegbYKoivv597ZRHbFGdKAqZlfyYUFOvO9p5WA/FJzugyL WqU4BHSX4IWevBBgj+t4FF1qmo8Sh1Asbra344zUfM2T3AXHOsNcAPznT7xyG6GF2RAM tQafv3gMmG+1SEFeVF3BUirfYx4g0edoua5Rqy3LgtW0n8nZMp+dxXsh6AWJjBtfUowv YIJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pX4vvzhqQpS3bc4F/W4I2SfMJijwGfbNVbpfQII7EvE=; b=t5TlvV7vzHIk/RpSWEaWVucxTD0vJ6KFSjAN+9zgX2EncMvEC92YzL0Fp0DDTMc8ke nMA9zMQsYGkq4Z/kqG6BD9dqNCSiLE4/SQEcPLZnQOBKUfPbWDB67nixsr40Lf1ifUhv iCzH0KTjkmZ/j3NDf3Su8VYrAlCiS1klTn1n4+oElb1J1bBlTfrHVtGSdsoeLE3EDXhF UPB4DOwa70ONjrjqGo5uYg7jSmn9dkaT74rytve/tCF1iOB0of7wav6RwTrL6lF6T66A AHbp7VtYa13Qfutj6Tv1i39vqJgk1zBltqVHl6zSgh0sXFbCEpZUmGnwYxHYfcumHOGt PJSg== X-Gm-Message-State: AODbwcCs5u3kRie8pHPRiwOVQRQDWi0ja3L79VTCzrkwF+ulGZiXb5As FxYUlVjMKbkW9ZtzuWc= X-Received: by 10.223.181.147 with SMTP id c19mr1746724wre.45.1495097912282; Thu, 18 May 2017 01:58:32 -0700 (PDT) Received: from [10.36.226.98] ([80.169.137.53]) by smtp.googlemail.com with ESMTPSA id i11sm4688259wrb.44.2017.05.18.01.58.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 01:58:31 -0700 (PDT) Subject: Re: Java 9 java.net.Authenticator api change To: dev@cxf.apache.org References: From: Sergey Beryozkin Message-ID: Date: Thu, 18 May 2017 09:58:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit archived-at: Thu, 18 May 2017 08:58:37 -0000 Hi Request for Option2 (or something similar like clone()) is more likely to be accepted IMHO Cheers, Sergey On 17/05/17 23:09, Adam T Anderson wrote: > > > Hello, > > In CXF we use org.apache.cxf.transport.http.ReferencingAuthenticator to > create a chain of org.apache.cxf.transport.http.CXFAuthenticators. > Every time we add a new CXFAuthenticator we set the new link as the default > authenticator and link to the old head. This is so we can delegate the > static call Authenticator.requestPasswordAuthentication() to a non-static > list of instances of CXFAuthenticator. > > When Authenticator.requestPasswordAuthentication() is called, the JDK pass > es in the requesting host, port, protocol, scheme etc... which get set as > private variables on the current head ReferencingAuthenticator and then > ReferencingAuthenticator.getPasswordAuthentication() gets called. > ReferencingAuthenticator.getPasswordAuthentication() uses deep reflection > to copy the private non-static variables of java.net.Authenticator from the > head to each link in the chain before calling getPasswordAuthentication() > on each of the wrapped CXFAuthenticators. > > This will no longer work in Java 9 with the new jigsaw module changes. We > need a mechanism in Java 9 to copy those private variables from one > authenticator to another for our Authenticator chain to work. > > The 2 options I see are: > > 1. Request Oracle to add setter methods for each variable (there are > already getters) to the Authenticator API. > 2. Request Oracle to add a "copyState" method to the Authenticator API > which copies all private non-static variables of one Authenticator to > another. > > Right now I am leaning towards options #2. > > What are your thoughts? Are there any other options to make this work with > Java 9? >