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 D1A0D200CA8 for ; Thu, 1 Jun 2017 05:03:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D0252160BDB; Thu, 1 Jun 2017 03:03:25 +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 F1C54160BCB for ; Thu, 1 Jun 2017 05:03:24 +0200 (CEST) Received: (qmail 5771 invoked by uid 500); 1 Jun 2017 03:03:24 -0000 Mailing-List: contact dev-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list dev@polygene.apache.org Received: (qmail 5759 invoked by uid 99); 1 Jun 2017 03:03:23 -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, 01 Jun 2017 03:03:23 +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 EF9E6CEA8F for ; Thu, 1 Jun 2017 03:03:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.481 X-Spam-Level: ** X-Spam-Status: No, score=2.481 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=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 bEiYDmdrNDnd for ; Thu, 1 Jun 2017 03:03:21 +0000 (UTC) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 31EBF5F19D for ; Thu, 1 Jun 2017 03:03:21 +0000 (UTC) Received: by mail-lf0-f41.google.com with SMTP id 99so19044428lfu.1 for ; Wed, 31 May 2017 20:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=Yu4PkRXST0uGHBw2aDu162fUs6XO5YubHviRT0/hXto=; b=BTi0X6KrEMGydL4mWgVVnxVrTZEEcgPrp0q6Bk3zynds8CUH63uf8YS4aCuV9mDw/U 2HSq7jsBMCdekzhpd1DSQr8BC15AqaxNik7uvxz+DOOBGKGcUoT2ER2twoU73vYvr+LB ZOHEzsSCPcNk4wVDChpzB49PCBgYU72cY81kNsuvaYH3cOFIu4Hl4YUcCFBbOpWKcIcJ wkj36/074h0thcy/SSZi9jqPBk3z1pDd+gWcEKCuCQyhQISK9Bb+pCbT3aYYQrfjDQq4 TGGgeGXM0B4VfkwGdV750/gSp4LO89IWr09YWGjqaie6NZ6YmRLibNy2hx0yqjpOqW+Q xtgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=Yu4PkRXST0uGHBw2aDu162fUs6XO5YubHviRT0/hXto=; b=Bfqgic8Rj4uHMinfnGNazLMGFaeQ6V2Vjl/XfnGjtJ6FivqkBsNV/s2rMPppL7hwk+ xvybqJ0nB3HEpvnkwWDBGEwqqgK//x8rqF0dZ7SY8NfEzSAxJLz53a2hIp2d7OYdb2sM kWcI2zw+tx7gb1WFpLqLCbfeeMR42E/kzddFqXR3hOCCQmNGwndjEV5vNjLi9b2KBPzq hPGfEr0m0ULMZX1qUI/YX5KZzpjX4BYjPF2fu+NKSBtOf5fUhcaT5I8ZazwO7ASWd2H1 LXCka2KG+ux5HwtsvReyENMSeytBZ20MGMieQgCVJu+6w3gjwx+O7pmfHY6GSYF0Lher bv1A== X-Gm-Message-State: AODbwcAuIqzuTRGg1M+PG74C2RS/qZvctqbgiZx0ezu+XJ1rPFzZQiwM St+nwsasHDPJwUZ9ESBS0v8lGaiZCMWN X-Received: by 10.25.219.156 with SMTP id t28mr9688954lfi.42.1496286200416; Wed, 31 May 2017 20:03:20 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.46.83.28 with HTTP; Wed, 31 May 2017 20:02:59 -0700 (PDT) In-Reply-To: References: From: Niclas Hedhman Date: Thu, 1 Jun 2017 11:02:59 +0800 X-Google-Sender-Auth: v-sn_ZVwKxnDbAgVfqhTyjc_j94 Message-ID: Subject: Re: Configuration structure To: dev@polygene.apache.org Content-Type: multipart/alternative; boundary="94eb2c184bfa754e770550dd47be" archived-at: Thu, 01 Jun 2017 03:03:26 -0000 --94eb2c184bfa754e770550dd47be Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable By allowing the fallback to system properties and/or environment variables for configuration, it would be a lot easier to provide configuration from commandline. But the devil is in the details. 1. Should it be fallback for a single unset property? 2. Should it be only for complete missing initial properties file? 3. Should it be only for first initialization, or should it use it even if an Entity is present? 4. Should there be some kind of "name space" in the System properties, or should the "name" be enough? I think it would be pretty cool if one could simply do; public interface MyConfiguration { Property osName(); Property userDir(); } and get those directly populated from System properties. Hmmm... Could that be done via Lifecycle? No, because the validation check kicks in before the Lifecycle methods are called. Maybe, just maybe, all this special handling in Configuration should actual be pushed to some type of Fragment that gets a go at it before the validation is done. Because if we could do that generically, and have a compatible implementation for current Configuration behavior, I think we are much much better off, and the semantics are effectively in the hands of users. I think we push it to 3.1 since there are too many questions to be hashed out and not enough time to try it out. On Tue, May 30, 2017 at 1:23 AM, Kent S=C3=B8lvsten wrote: > I think it is a very good idea. > > As long as we retain an opt-out possibility to avoid accessing the > system-properties (reasons to avoid them could either be "pureness" reaso= ns > or the presence of a securitymanager). > > On Mon, May 29, 2017 at 9:33 AM, Niclas Hedhman > wrote: > > > The least intrusive implementation of this is to take out the exception > > thrown on org/apache/polygene/api/composite/PropertyMapper.java:117. > Then > > add the backup for the two maps mentioned above, with some > > strategy/priority. > > > > Niclas > > > > On Mon, May 29, 2017 at 1:47 PM, Niclas Hedhman > > wrote: > > > > > Hi, > > > > > > at the moment, the content of the properties file drives what is > expected > > > in the ConfigurationComposite. If there are more properties than ther= e > > are > > > declared and matching Proprety<> methods, then there is an Exception. > > > > > > This might have been rational back in the days when this was discusse= d > > > first time, but if we are heading towards supporting external and > perhaps > > > more exotic configuration "supply-chains", then I think it would be > more > > > logical that the ConfigurationComposite simply reads what it wants an= d > > > ignores everything else. > > > > > > AND then would could have this super cool addition that if no files a= re > > > found that works, fall back to System.getProperties() and > > System.getenv() as > > > the final backups. > > > > > > WDYT? > > > > > > Cheers > > > -- > > > Niclas Hedhman, Software Developer > > > http://polygene.apache.org - New Energy for Java > > > > > > > > > > > -- > > Niclas Hedhman, Software Developer > > http://polygene.apache.org - New Energy for Java > > > --=20 Niclas Hedhman, Software Developer http://polygene.apache.org - New Energy for Java --94eb2c184bfa754e770550dd47be--