firethorn

changeset 4266:d05c4df148d9 2.1.33-stv-tap-swarm

Context Factory change, read firethorn host from env variable if it exists
author Stelios <stv@roe.ac.uk>
date Thu Jul 18 14:07:00 2019 +0300 (2019-07-18)
parents 9e557d1a5a59
children e0f65ee972b9
files firethorn-ogsadai/activity/context/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/context/RequestContextFactory.java
line diff
     1.1 --- a/firethorn-ogsadai/activity/context/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/context/RequestContextFactory.java	Thu Jul 18 13:57:24 2019 +0300
     1.2 +++ b/firethorn-ogsadai/activity/context/src/main/java/uk/ac/roe/wfau/firethorn/ogsadai/context/RequestContextFactory.java	Thu Jul 18 14:07:00 2019 +0300
     1.3 @@ -11,13 +11,10 @@
     1.4  import uk.ac.roe.wfau.firethorn.ogsadai.activity.common.chaos.MonkeyParam;
     1.5  import uk.ac.roe.wfau.firethorn.ogsadai.activity.common.chaos.MonkeyParamImpl;
     1.6  import uk.org.ogsadai.service.rest.authorisation.SecurityContextFactory;
     1.7 -import org.springframework.beans.factory.annotation.Value;
     1.8 -import org.springframework.stereotype.Component;
     1.9  
    1.10  /**
    1.11   *
    1.12   */
    1.13 -@Component
    1.14  public class RequestContextFactory
    1.15  implements SecurityContextFactory
    1.16  	{
    1.17 @@ -82,8 +79,11 @@
    1.18                      this.protocol = protocol;
    1.19                      }
    1.20                  
    1.21 -                @Value("${firethorn.host:#{localhost2}}")
    1.22 -                private String host;
    1.23 +                private String host = (remote != null) ? remote : DEFAULT_HOST ;
    1.24 +                if (System.getenv("firethornhost") != null) {
    1.25 +                    host = System.getenv("firethornhost").trim();
    1.26 +                } 
    1.27 +
    1.28                  @Override
    1.29                  public String host()
    1.30                      {