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

[#252] Support for 'addresshierarchy' domain. #254

Merged
merged 11 commits into from
Nov 8, 2023

Conversation

Ruhanga
Copy link
Member

@Ruhanga Ruhanga commented Oct 31, 2023


try {
AddressConfigurationLoader.loadAddressConfiguration(Paths.get(iniz.getConfigDirPath()), Paths.get(iniz.getChecksumsDirPath()), getDomain().toString());
Context.getService(AddressHierarchyService.class).initI18nCache();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mogoodrich this is always gona initialize the i18n cache at startup from here. initializeFullAddressCache() is implicitly called by AddressConfigurationLoader.loadAddressConfiguration(...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also tweaked this to ensure the initializeFullAddressCache is always called not only when checksums are changed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would seem like Initializer should stick to loading in AH entries, and not try to take responsibllity over the full address cache or the i18n cache. I'd be more inclined to make changes to the AddressConfigurationLoader.loadAddressConfiguration method to ensure these caches are initialized whenever it is called. Basically at the bottom of AddressConfigurationLoader.loadAddressConfiguration:

1 If the AH entries are changed and reloaded, it should reload these caches
2.If the AH entries are not changed and reloaded, but the caches have not been initialized yet, reload these caches

@mogoodrich does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @mseaton that is my preference as well, that Iniz sticks to loading metadata, and not being responsible for setting up in-memory caches.

I believe the original loadAddressConfiguration method already did #1: reloads the cache if the AH entries are reloaded. #2 could be added as well, but is not really necessary if the if we keep the method that refreshes the cache in the contextRefreshed method of the Address Hierarchy activator.

@Ruhanga @mks-d I assume the intent of Iniz is primarily to do metadata loading, not to do overall module start-up tasks? For instance, if for some reason Iniz was uninstalled from an implementation, I'd still expect a module to start up properly, as long as it's metadata was already loaded?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the intent of Iniz is primarily to do metadata loading, not to do overall module start-up tasks?

Yes, I think that's explicitly the purpose here.

Copy link
Member Author

@Ruhanga Ruhanga Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For instance, if for some reason Iniz was uninstalled from an implementation, I'd still expect a module to start up properly, as long as it's metadata was already loaded?

@mogoodrich, @ibacher, this would cause some malfunctioning already(as is the case) since Iniz does load the i18n message properties necessary for proper cache initialization from the now proxy addresshierarchy domain (in the context of Iniz).


try {
AddressConfigurationLoader.loadAddressConfiguration(Paths.get(iniz.getConfigDirPath()), Paths.get(iniz.getChecksumsDirPath()), getDomain().toString());
Context.getService(AddressHierarchyService.class).initI18nCache();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would seem like Initializer should stick to loading in AH entries, and not try to take responsibllity over the full address cache or the i18n cache. I'd be more inclined to make changes to the AddressConfigurationLoader.loadAddressConfiguration method to ensure these caches are initialized whenever it is called. Basically at the bottom of AddressConfigurationLoader.loadAddressConfiguration:

1 If the AH entries are changed and reloaded, it should reload these caches
2.If the AH entries are not changed and reloaded, but the caches have not been initialized yet, reload these caches

@mogoodrich does that make sense?

@mks-d mks-d changed the title [#252]: Support explicit addresshierarchy domain. [#252]: Support for 'addresshierarchy' domain. Nov 6, 2023
readme/addresshierarchy.md Outdated Show resolved Hide resolved
@mks-d mks-d changed the title [#252]: Support for 'addresshierarchy' domain. [#252] Support for 'addresshierarchy' domain. Nov 8, 2023
@mks-d mks-d merged commit 4be0bf7 into mekomsolutions:master Nov 8, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants