Package org.springframework.core.env

Examples of org.springframework.core.env.StandardEnvironment


  @Override
  public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
    // this enables resolving from xml
    log.info("Adding PropertyEditorRegistrar");
    beanFactory.addPropertyEditorRegistrar(new ResourceEditorRegistrar(loader, new StandardEnvironment()));
  }
View Full Code Here


    if (environment != null) {
      return environment;
    }

    return resourceLoader instanceof EnvironmentCapable ? ((EnvironmentCapable) resourceLoader).getEnvironment()
        : new StandardEnvironment();
  }
View Full Code Here

  @Before
  public void setUp() {

    AnnotationMetadata annotationMetadata = new StandardAnnotationMetadata(SampleConfiguration.class, true);
    environment = new StandardEnvironment();
    resourceLoader = new DefaultResourceLoader();
    source = new AnnotationRepositoryConfigurationSource(annotationMetadata, EnableRepositories.class, resourceLoader,
        environment);
  }
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

  DummyRegistrar registrar;

  @Before
  public void setUp() {

    environment = new StandardEnvironment();

    registrar = new DummyRegistrar();
    registrar.setEnvironment(environment);
  }
View Full Code Here

   * @param ctx
   * @param customer
   */
  private void setEnvironmentForCustomer(ConfigurableApplicationContext ctx,
      String customer) {
    StandardEnvironment env = new StandardEnvironment();
    Properties props = new Properties();
    // populate properties for customer
    props.setProperty("host", "host.for." + customer);
    props.setProperty("user", "user");
    props.setProperty("password", "password");
    props.setProperty("remote.directory", "/tmp");
    PropertiesPropertySource pps = new PropertiesPropertySource("ftpprops", props);
    env.getPropertySources().addLast(pps);
    ctx.setEnvironment(env);
  }
View Full Code Here

   * @deprecated as of Spring 3.1 in favor of
   * {@link #ResourceEditorRegistrar(ResourceLoader, PropertyResolver)}
   */
  @Deprecated
  public ResourceEditorRegistrar(ResourceLoader resourceLoader) {
    this(resourceLoader, new StandardEnvironment());
  }
View Full Code Here

  /**
   * Create a new instance of the {@link ResourceEditor} class
   * using a {@link DefaultResourceLoader} and {@link StandardEnvironment}.
   */
  public ResourceEditor() {
    this(new DefaultResourceLoader(), new StandardEnvironment());
  }
View Full Code Here

   * @deprecated as of Spring 3.1 in favor of
   * {@link #ResourceEditor(ResourceLoader, PropertyResolver)}
   */
  @Deprecated
  public ResourceEditor(ResourceLoader resourceLoader) {
    this(resourceLoader, new StandardEnvironment(), true);
  }
View Full Code Here

   * @deprecated as of Spring 3.1 in favor of
   * {@link #ResourceEditor(ResourceLoader, PropertyResolver, boolean)}
   */
  @Deprecated
  public ResourceEditor(ResourceLoader resourceLoader, boolean ignoreUnresolvablePlaceholders) {
    this(resourceLoader, new StandardEnvironment(), ignoreUnresolvablePlaceholders);
  }
View Full Code Here

TOP

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

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.