Package org.springframework.core.env

Examples of org.springframework.core.env.ConfigurableEnvironment.containsProperty()


  public static void main(String... args) throws Exception{

    final GenericXmlApplicationContext context = new GenericXmlApplicationContext();

    final ConfigurableEnvironment env = context.getEnvironment();
    boolean mapQuestApiKeyDefined = env.containsProperty("mapquest.apikey");

    if (mapQuestApiKeyDefined) {
      env.setActiveProfiles("mapquest");
    }
View Full Code Here


    subject = scanner.nextLine();

    System.out.print("What is the body of the message?: ");
    body = scanner.nextLine();

    if (!environment.containsProperty("accessKey")) {
      System.out.print("Please enter your access key: ");
      final String accessKey = scanner.nextLine();
      environment.getSystemProperties().put("accessKey", accessKey);
    }
View Full Code Here

      System.out.print("Please enter your access key: ");
      final String accessKey = scanner.nextLine();
      environment.getSystemProperties().put("accessKey", accessKey);
    }

    if (!environment.containsProperty("secretKey")) {
      System.out.print("Please enter your secret key: ");
      final String secretKey = scanner.nextLine();
      environment.getSystemProperties().put("secretKey", secretKey);
    }
View Full Code Here

        break;
      } else if("2".equals(input.trim())) {
        environment.setActiveProfiles("aws");

        if (!environment.containsProperty("accessKey")) {
          System.out.print("\nPlease enter your access key: ");
          final String accessKey = scanner.nextLine();
          environment.getSystemProperties().put("accessKey", accessKey);
        }
View Full Code Here

          System.out.print("\nPlease enter your access key: ");
          final String accessKey = scanner.nextLine();
          environment.getSystemProperties().put("accessKey", accessKey);
        }

        if (!environment.containsProperty("secretKey")) {
          System.out.print("\nPlease enter your secret key: ");
          final String secretKey = scanner.nextLine();
          environment.getSystemProperties().put("secretKey", secretKey);
        }
        System.out.print("\nTo which email address would you like to send a message?: ");
View Full Code Here

  }

  @Override
  public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
    ConfigurableEnvironment environment = event.getEnvironment();
    if (!environment.containsProperty(VCAP_APPLICATION)
        && !environment.containsProperty(VCAP_SERVICES)) {
      return;
    }
    Properties properties = new Properties();
    addWithPrefix(properties, getPropertiesFromApplication(environment),
View Full Code Here

  @Override
  public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
    ConfigurableEnvironment environment = event.getEnvironment();
    if (!environment.containsProperty(VCAP_APPLICATION)
        && !environment.containsProperty(VCAP_SERVICES)) {
      return;
    }
    Properties properties = new Properties();
    addWithPrefix(properties, getPropertiesFromApplication(environment),
        "vcap.application.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.