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 <[email protected]> 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 <[email protected]> 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 > > > > >
