Community
Participate
Working Groups
Currently, there doesn't seem to be any way to follow the progress while loading a Resource. ResourceSet#getResource is blocking until the Resource is fully loaded. It would be useful to be able to receive notifications as the Resource is being loaded, for example through some sort of listener or callback mechanism, to be able to display a progress bar.
I'm not sure what kind of useful progress could be reported. It would certainly need to be up to each individual type of resource do implement such a thing, e.g., XMLResourceImpl... Generally resources load so quickly I'm not sure a human being would derive anything useful from dozens of updates happening in the course of a few seconds. What would be useful to report and wouldn't be produced in such volumes so as to add significantly to the overall time of loading?
Maybe the InputStream (in XMLLoadImpl) could be used (when loading a XMLResourceImpl) to know how many bytes have been read so far. By comparing this to the size of the file, we can get a percentage that can be reported back to the caller through a listener or callback. To avoid slowing down the loading process by sending too many notifications, we can send only significant changes, for example every 1%, or every megabyte read.
It all sounds complicated and invasive. Much of the loading is done when proxies are resolved in which case there's little opportunity for displaying progress.