-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
|
||
try { | ||
AddressConfigurationLoader.loadAddressConfiguration(Paths.get(iniz.getConfigDirPath()), Paths.get(iniz.getChecksumsDirPath()), getDomain().toString()); | ||
Context.getService(AddressHierarchyService.class).initI18nCache(); |
There was a problem hiding this comment.
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(...)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
#252