Skip to content

Allow different global configs in the same jvm #4007

Description

@jonenst

Describe the current behavior

Currently, there is -Dpowsybl.config.dirs or -Dpowsybl.config.name to allow switching the global configuration. This means it is possible to switch configuration between different JVMs.
But what if you need to switch configuration in a single jvm? The use case would still be to have static global configuration (not a 100% dynamic switch like in #2383 ).

Describe the expected behavior

I have no idea what this could look like unfortunately.

Describe the motivation

In my niche use case, I was using multiple wars deployed in the same tomcat so I wanted to scope the configuration to have warA use ~/.itools/configA and warB use ~/.itools/ConfigB

But I could imagine someone writing a program

main() {
  workA(); // tell users to configure this in configA.yaml
  workB(); // and this in configB.yaml
}

In many cases I think you can restructure the code to make it work but when you don't want to restructure the code you are stuck

Extra Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions