> @@ -113,18 +126,33 @@ public DriveInfo load(String input) {
>
> @Singleton
> @Provides
> - protected Map<String, WellKnownImage> provideImages(Json json, @Provider
> String providerName) throws IOException {
> - List<WellKnownImage> wellKnowns =
> json.fromJson(Strings2.toStringAndClose(getClass().getResourceAsStream(
> - "/" + providerName + "/preinstalled_images.json")), new
> TypeLiteral<List<WellKnownImage>>() {
> - }.getType());
> - return Maps.uniqueIndex(wellKnowns, new Function<WellKnownImage,
> String>() {
> -
> + @Memoized
> + protected Supplier<Map<String, WellKnownImage>>
> provideImages(@Named(PROPERTY_SESSION_INTERVAL) long seconds,
> + final @Memoized Supplier<List<WellKnownImage>>
> wellKnownImageSupplier) throws IOException {
> + // The image map won't change. Memoize it during the session.
> + // This map can't be created directly as a singleton, as Guice needs
> it to construct the ElasticStackComputeServiceAdapter
> + // and a missconfiguration such as invalid credentials, etc would
> cause the Guice injection to fail
[minor] "misconfiguration"
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/362/files#r13033750