Project

General

Profile

feature request #8187

Use Spring Environment instead of custom code in AbstractWebApplicationConfigurer

Added by Andreas Kohlbecker 5 months ago. Updated 29 days ago.

Status:
New
Priority:
Priority13
Category:
cdmlib
Target version:
Start date:
03/20/2019
Due date:
% Done:

0%

Severity:
normal

Description

the method AbstractWebApplicationConfigurer.findProperty(String property, boolean required) implements a similar strategy as the Spring AbstractEnvironment which has a configurable strategy to resolve properties via the PropertySourcesPropertyResolver

See

  1. StandardServletEnvironment searches for properties from the sources in the below order. Properties in any of the below will take precedence over system properties and environment variables contributed by the StandardEnvironment superclass.
    1. "servletConfigInitParams"
    2. "servletContextInitParams"
    3. "jndiProperties"
  2. org.springframework.core.env.StandardEnvironment searches for properties from the sources in the following order:
    1. system properties
    2. system environment variables

The AbstractWebApplicationConfigurer uses the following sources in the order as listed below:

  1. attribute to the ServletContext
  2. system property
  3. ~/.cdmLibrary/cdmlib-remote.properties this is used by developers to define the datasource bean to use from the datasources.xml. It is not relevant for production systems.

Using the Şpring Environment would simplify setting up test an production environments a lot since we would be able to use application properties files and System properties to configure hibernate, spring profiles etc... and may also help solving the problem of the creation of datasources via Spring HTTP-Invoker (#5601)

When switching to the Şpring Environment we would need a replacement for the mechanism which loads ~/.cdmLibrary/cdmlib-remote.properties. This can be easily replaced by
@PropertySource("file:${user.home}/.cdmLibrary/cdmlib-remote.properties")


Related issues

Related to Edit - bug #5601: [DISCUSS] Creation of database structure via remoting New 07/06/2016
Related to Edit - bug #8189: Allow configuration of 'user.home' via the spring environment Feedback 03/21/2019

History

#1 Updated by Andreas Kohlbecker 5 months ago

  • Description updated (diff)
  • Assignee changed from Andreas Müller to Andreas Kohlbecker

#2 Updated by Andreas Kohlbecker 5 months ago

  • Description updated (diff)

#3 Updated by Andreas Kohlbecker 5 months ago

  • Related to bug #5601: [DISCUSS] Creation of database structure via remoting added

#4 Updated by Andreas Kohlbecker 5 months ago

  • Description updated (diff)

#5 Updated by Andreas Kohlbecker 5 months ago

  • Related to bug #8189: Allow configuration of 'user.home' via the spring environment added

#6 Updated by Andreas Kohlbecker 4 months ago

  • Target version changed from Release 5.6 to Release 5.7

#7 Updated by Andreas Müller 4 months ago

  • Target version changed from Release 5.7 to Release 5.8

#8 Updated by Andreas Kohlbecker 29 days ago

  • Target version changed from Release 5.8 to Release 5.10

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)