> +import org.jclouds.domain.Credentials;
> +import org.jclouds.location.Provider;
> +
> +import javax.inject.Inject;
> +import javax.inject.Singleton;
> +import java.io.IOException;
> +
> +@Singleton
> +public class ConfigurationSupplier implements Supplier<Configuration> {
> + private final Configuration configuration;
> +
> + @Inject
> + public ConfigurationSupplier(@Provider Supplier<Credentials> creds) {
> + Configuration configuration ;
> + try {
> + configuration =
> PublishSettingsLoader.createManagementConfiguration(creds.get().credential,
> creds.get().identity);
Suppliers are used to defer the work until it is actually needed, so this logic
should be moved to the `get` method. If you need to cache the results of the
call to get, consider decorating the supplier with `Suppliers.memoize` or
similar when configuring it in the corresponding module.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/132/files#r24748375