In the Apache Felix framework that Jira runs on, there is a concept that allows you to define configuration files with hotswap functionality. Is this somehow possible to achieve in Jira Plugins as well?
Example from Karaf
In Karaf - which also is based on Apache Felix - this works by annotating Spring/Blueprint components with a configuration class, such as:
@Component(name="MyComponent")
@Designate(ocd = MyConfig.class)
public class MyComponentImpl implements MyComponent {
@Activate
public void activate(MyConfig config) {
// Do something with the config object
AssertTrue(config.getUsername() == "username")
}
}
Then define that configuration class with some default values:
@ObjectClassDefinition(name = "MyConfigFileName")
@interface MyConfig {
String username() default "username";
String password() default "password";
}
If you then drop a file named `MyConfigFileName.cfg` into the folder `karafhome/etc`, the Apache Felix framework will reload all Spring components (here `MyComponent`) that use the `MyConfig` configuration, and update it's values:
# MyConfigFileName.cfg
username = helloWorld
password = h3110W0rld!
Is this possible in Jira?
From what I understand, the functionality described above should be possible to achieve in Jira as well, but the question is: how? If we import the Maven dependency required for the annotations and give it a spin, which folder should configurations be added to?