From users-return-6173-archive-asf-public=cust-asf.ponee.io@isis.apache.org Sun Nov 18 12:20:42 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2DCA018066C for ; Sun, 18 Nov 2018 12:20:42 +0100 (CET) Received: (qmail 38269 invoked by uid 500); 18 Nov 2018 11:20:41 -0000 Mailing-List: contact users-help@isis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@isis.apache.org Delivered-To: mailing list users@isis.apache.org Received: (qmail 38257 invoked by uid 99); 18 Nov 2018 11:20:41 -0000 Received: from ui-eu-01.ponee.io (HELO localhost) (176.9.59.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Nov 2018 11:20:41 +0000 Date: Sun, 18 Nov 2018 11:20:39 -0000 Message-ID: To: x-ponymail-sender: c068aa2dca0e53ffba56f968adfd76454b89e063 Subject: Re: We'd like to remove "isis.deploymentType" ... any objections? From: Andi Huber x-ponymail-agent: PonyMail Composer/0.3 In-Reply-To: References: Content-Type: text/plain; charset=utf-8 MIME-Version: 1.0 X-Mailer: LuaSocket 3.0-rc1 Jayesh, you are absolutely right. And I changed the logic mentioned earlier again, so don't take this as a reference. Sure, we will provide documentation and details with the next milestone release. Again thanks everybody, it seems we converged on a solution! Cheers, Andi! On 2018/11/17 17:31:00, Jayesh Prajapati wrote: > Hi Andi, > This is very good explanation and I think it must be part of two > documentation viz., 2.0 migration notes and beyond the basics guide. > Personally, I have found these two documentation very useful. > > Thanks, > Jayesh > > On Sat, Nov 17, 2018 at 9:31 PM Andi Huber wrote: > > > Thanks Dan, I think that makes sense! > > > > Branch v2 has progressed, such that we now have a SPI for determinig the > > deployment-type. I've done this without changing too much of the previous > > behaviour (at least thats the intention). > > > > Instead I added some deprecation markers pointing to the new SPI, > > especially regarding the lately introduced 'environment priming logic'. > > > > Resource names however did change, I have not reinstated the previous > > behavior here: > > server.properties -> production.properties > > server_prototype.properties -> prototyping.properties > > > > > > Here's the default logic, for determing the deployment type: > > > > public DeploymentType getDeploymentType() { > > > > boolean anyVoteForPrototyping = false; > > > > anyVoteForPrototyping|= > > > > "true".equalsIgnoreCase(System.getenv("PROTOTYPING")); > > > > anyVoteForPrototyping|= > > > > "server_prototype".equalsIgnoreCase(System.getProperty("isis.deploymentType")); > > > > anyVoteForPrototyping|= > > > > "PROTOTYPING".equalsIgnoreCase(System.getProperty("isis.deploymentType")); > > > > final DeploymentType deploymentType = > > anyVoteForPrototyping > > ? DeploymentType.PROTOTYPING > > : > > DeploymentType.PRODUCTION; > > > > return deploymentType; > > } > > > > The make use of the SPI, one needs to implement this interface: > > > > public interface IsisSystemEnvironmentPlugin { > > > > public IsisSystemEnvironment getIsisSystemEnvironment(); > > > > } > > > > For details see the sources and a 'reference' implementation see [1] and > > [2] > > > > [1] > > https://github.com/apache/isis/blob/v2/core/commons/src/main/java/org/apache/isis/core/plugins/environment/IsisSystemEnvironmentPlugin.java > > [2] > > https://github.com/apache/isis/blob/v2/core/integtestsupport/src/main/java/org/apache/isis/core/integtestsupport/components/IsisSystemEnvironmentPluginForTesting.java > > > > >