Package org.springframework.core.env

Examples of org.springframework.core.env.Environment


   */
  public BeanDefinition parse(Element element, ParserContext parser) {

    try {

      Environment environment = parser.getDelegate().getEnvironment();
      ResourceLoader resourceLoader = parser.getReaderContext().getResourceLoader();
      BeanDefinitionRegistry registry = parser.getRegistry();

      XmlRepositoryConfigurationSource configSource = new XmlRepositoryConfigurationSource(element, parser, environment);
      RepositoryConfigurationDelegate delegate = new RepositoryConfigurationDelegate(configSource, resourceLoader,
View Full Code Here


  private final Set<CdiRepositoryBean<?>> eagerRepositories = new HashSet<CdiRepositoryBean<?>>();
  private final CustomRepositoryImplementationDetector customImplementationDetector;

  protected CdiRepositoryExtensionSupport() {

    Environment environment = new StandardEnvironment();
    ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver(getClass().getClassLoader());
    MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader);

    this.customImplementationDetector = new CustomRepositoryImplementationDetector(metadataReaderFactory, environment,
        resourceLoader);
View Full Code Here

   * @see ConfigurableEnvironment#merge(ConfigurableEnvironment)
   */
  public void setParent(ApplicationContext parent) {
    this.parent = parent;
    if (parent != null) {
      Environment parentEnvironment = parent.getEnvironment();
      if (parentEnvironment instanceof ConfigurableEnvironment) {
        getEnvironment().merge((ConfigurableEnvironment) parentEnvironment);
      }
    }
  }
View Full Code Here

      model.addAttribute("msg_warning", "error.email");
      return "/admin/common/forgotten";
    }
   
    Map<String, Object> params = new HashMap<String, Object>();
    Environment env = getSettingService().getEnvironment();
    String serverUrl = request.isSecure()?env.getProperty("app.http")
        :env.getProperty("app.https");
    String code = userAdminModel.generateCode(email);
    params.put("serverUrl", serverUrl);
    params.put("url", serverUrl+"/admin/common/reset?code="+code);
    params.put("email", email);
    params.put("ipAddress", request.getRemoteAddr());
View Full Code Here

public class EnvironmentTest {

    @Test
    public void test() {
        //会自动注册 System.getProperties() 和 System.getenv()
        Environment environment = new StandardEnvironment();
        System.out.println(environment.getProperty("file.encoding"));
        System.out.println(environment.getProperty("data"));


    }
View Full Code Here

    }

    @Test
    public void noProfileSpecified() {
        // activateProfiles(...);
        Environment env = runApp().getEnvironment();
        assertThat(env.acceptsProfiles(env.getDefaultProfiles()), is(true));
        assertThat(env.acceptsProfiles(CLOUDFOUNDRY), is(false));
        assertThat(env.acceptsProfiles(STANDALONE), is(true));
    }
View Full Code Here

   */
  @Override
  public void setParent(ApplicationContext parent) {
    this.parent = parent;
    if (parent != null) {
      Environment parentEnvironment = parent.getEnvironment();
      if (parentEnvironment instanceof ConfigurableEnvironment) {
        getEnvironment().merge((ConfigurableEnvironment) parentEnvironment);
      }
    }
  }
View Full Code Here

      }
      return wrapped.interpolate(rawPlusDefaults);
    }

    private Object computeDefault(ModuleOption option) {
      Environment moduleEnvironment = lookupEnvironment(moduleDefinition);
      String fqKey = fullyQualifiedKey(moduleDefinition, option.getName());
      return moduleEnvironment.getProperty(fqKey);
    }
View Full Code Here

    }
  };

  private void onApplicationEnvironmentPreparedEvent(
      ApplicationEnvironmentPreparedEvent event) {
    Environment environment = event.getEnvironment();
    if (environment instanceof ConfigurableEnvironment) {
      onApplicationEnvironmentPreparedEvent((ConfigurableEnvironment) environment,
          event.getSpringApplication());
    }
  }
View Full Code Here

    String override = SystemProperties.get(SYSTEM_PROPERTY_VARIABLES);
    if (override != null) {
      pidFile = new File(override);
    }
    else {
      Environment environment = getEnvironment(event);
      if (environment != null) {
        override = new RelaxedPropertyResolver(environment)
            .getProperty(SPRING_PROPERTY);
        if (override != null) {
          pidFile = new File(override);
View Full Code Here

TOP

Related Classes of org.springframework.core.env.Environment

Copyright © 2018 www.massapicom. 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.