Hi all,
In openmrs-module-appframework
the activator is loading all configured extensions.
List<Extension> extensions = appFrameworkFactory.getExtensions();
if (extensions != null) {
allFreeStandingExtensions.add(extensions);
}
the allFreeStandingExtensions.add(extensions)
validates and adds extensions one by one to the list allFreeStandingExtensions.
public void add(List<Extension> extensions) {
for (Extension extension : extensions) {
add(extension);
}
}
public void add(Extension extension) {
validate(extension);
synchronized (this.extensions) {
this.extensions.add(extension);
Collections.sort(this.extensions);
}
}
Here validate method throws an exception if an extension id is a duplicate, and once the exception is thrown no further extensions will be added to the list.
Eg: If there are 10 extensions and the id of the 7th extension is same the Id of any one of the extension added before it, this will throw an exception and hence the 8th, 9th and 10th extension will not be loaded as well.
Can someone please let us if this is done by choice?
In the given example won’'t it be a better approach if we manage to add the 8th, 9th and 10th extension even after the 7th throws an exception.
cc : @angshuonline @mksd