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

add lazy property initialization api to SystemPropertiesSupport #3049

Closed

Conversation

kkriske
Copy link
Contributor

@kkriske kkriske commented Dec 5, 2020

From custom features, it is possible to set default values of system properties using:

SystemPropertiesSupport systemProperties = ImageSingletons.lookup(SystemPropertiesSupport.class);
systemProperties.initializeProperty("property.name", "property.value");

This suggestion adds a way to add lazily computed properties as well, so these don't run at startup time.
One possible reason to want this (like in my case), is if the custom property relies on one of the lazy property values, such as user.dir.

I'm actually not sure if this way of adding custom properties is supposed to be public api, as the question to add custom properties at build-time has risen a few times, but was never answered with a solution in the line of getting the SystemPropertiesSupport object.

This may slightly interfere with the changes of #2834.

@kkriske kkriske force-pushed the lazy-property-initialization-api branch from aa2506f to 3d36dae Compare December 5, 2020 22:41
@kkriske
Copy link
Contributor Author

kkriske commented Jan 15, 2021

This needs some more work to properly provide the required feature API. But before I do, could I get some feedback on whether this is something we want to support or not?

@kkriske
Copy link
Contributor Author

kkriske commented Jun 25, 2023

closing as this is a can of worms not worth opening just yet, more info: #5557 (comment)

@kkriske kkriske closed this Jun 25, 2023
@kkriske kkriske deleted the lazy-property-initialization-api branch June 25, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants