JavaMoney / jsr354-ri

JSR 354 - Moneta: Reference Implementation
Other
334 stars 100 forks source link

Convert org.javamoney.moneta.spi.loader.LoadableResource into an interface #397

Closed ab666 closed 10 months ago

ab666 commented 10 months ago

Having the LoadableResource as interface would allow for a more flexible extensibility of the service.

keilw commented 10 months ago

That might help, would you have a PR for that?

ab666 commented 10 months ago

It appears that 'LoadbleResource' has been refactored into 'LoadableURLResource' in master. Any plans to release 1.4.3 soon?

keilw commented 10 months ago

That depends on the open issues in https://github.com/JavaMoney/jsr354-ri/milestone/8, especially #353.

keilw commented 7 months ago

@ab666 FYI 1.4.3 was released 2 days ago. Since LoadableURLResource or the new LoadableHttpResource are internal implementation details, the only interface they both implement is DataStreamFactory. For now replacing the URLConnection based implementation with a more reliable OkHttp version looks sufficient. We might in future offer more than one LoaderService implementation, at least according to https://stackoverflow.com/questions/57374172/why-multiple-implementations-not-allowed-declare-as-module-service-in-module-inf that seems possible in the module-info, too, e.g. allowing to tweak it in Bootstrap.getService(), but for now switching back to the urlconnection variant is totally experimental and at your own risk (one has to build Moneta from scratch or patch it in the META-INF/services if they still use Java 8) Yet the only real relevant interface would be LoaderService, and there seems little value to turn any of these internal classes into interfaces.