Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ConfigurableEnvironment#addActiveProfile(String) [SPR-8548] #13192

Closed
spring-projects-issues opened this issue Jul 20, 2011 · 1 comment
Labels
type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Scott Andrews opened SPR-8548 and commented

With ConfigurableEnvironment, it is currently annoying to activate additional profile. You must get the array of active profiles, augment that array, and set the new array back on the environment. If there are ever multiple threads working with ConfigurableEnvironment, it's possible to have a timing issue and changes lost.

I would like to see an addActiveProfile method added to ConfigurableEnvironment.

ConfigurableEnvironment#addActiveProfile(String... activeProfiles)

Affects: 3.1 M2

@spring-projects-issues
Copy link
Collaborator Author

Chris Beams commented

commit c19aec61feea8797832d98a1768b33619b109754 (HEAD, SPR-8548)
Author: Chris Beams <cbeams@vmware.com>
Date:   Fri Aug 19 14:46:36 2011 -0700

    Introduce ConfigurableEnvironment#addActiveProfile
    
    Provides a convenient mechanism for activating an additional profile
    while preserving those that are already active, as opposed to
    calling #setActiveProfiles with the contents of #getActiveProfiles plus
    the new profile.
    
    Issue: SPR-8548

Scott, you may also be interested in this commit as well, e.g. if you wish to impose any additional constraints on profile names for CloudEnvironment users:

commit 2935d35f113bc6067aa4a89303f17dd178dd8a28
Author: Chris Beams <cbeams@vmware.com>
Date:   Fri Aug 19 14:43:25 2011 -0700

    Introduce AbstractEnvironment#validateProfile
    
    Consolidates validation for profiles and provides a mechanism for
    AbstractEnvironment subclasses to customize validation logic if
    desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant