isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jayesh Prajapati <jayesh...@gmail.com>
Subject Re: We'd like to remove "isis.deploymentType" ... any objections?
Date Sat, 17 Nov 2018 17:31:00 GMT
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 <ahuber@apache.org> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message