Package org.springframework.core.env

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


  private static AnnotationConfigApplicationContext context = null;

  public static void initialize() throws IOException {
    context = new AnnotationConfigApplicationContext();
    ConfigurableEnvironment environment = context.getEnvironment();
    environment.addActiveProfile("cryson_logging");
    PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
    configurer.setLocations(new Resource[]{context.getResource("advancedcrysondiary.properties"), context.getResource("cryson.properties")});
    context.addBeanFactoryPostProcessor(configurer);
    context.scan(Spring.class.getPackage().getName(), CrysonServer.class.getPackage().getName());
    context.refresh();
View Full Code Here


  }

  private static void configureProfiles() {
    ConfigurableEnvironment environment = context.getEnvironment();
    if ("true".equals(getProperty("cryson.httpserver.enabled"))) {
      environment.addActiveProfile("cryson_httpserver");
    }
    if ("true".equals(getProperty("cryson.database.enabled"))) {
      environment.addActiveProfile("cryson_database");
    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
View Full Code Here

    ConfigurableEnvironment environment = context.getEnvironment();
    if ("true".equals(getProperty("cryson.httpserver.enabled"))) {
      environment.addActiveProfile("cryson_httpserver");
    }
    if ("true".equals(getProperty("cryson.database.enabled"))) {
      environment.addActiveProfile("cryson_database");
    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
      environment.addActiveProfile("cryson_security");
    }
    if ("true".equals(getProperty("cryson.logging.enabled"))) {
View Full Code Here

    }
    if ("true".equals(getProperty("cryson.database.enabled"))) {
      environment.addActiveProfile("cryson_database");
    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
      environment.addActiveProfile("cryson_security");
    }
    if ("true".equals(getProperty("cryson.logging.enabled"))) {
      environment.addActiveProfile("cryson_logging");
    }
  }
View Full Code Here

    }
    if ("true".equals(getProperty("cryson.security.enabled"))) {
      environment.addActiveProfile("cryson_security");
    }
    if ("true".equals(getProperty("cryson.logging.enabled"))) {
      environment.addActiveProfile("cryson_logging");
    }
  }

  public static String getProperty(String propertyName) {
    if (properties == null) {
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.