nacx commented on this pull request.


> +import com.google.common.base.Function;
+import com.google.common.cache.LoadingCache;
+
+@Singleton
+public class TemplateToAvailabilitySet implements Function<Template, 
AvailabilitySet> {
+
+   @Resource
+   @Named(ComputeServiceConstants.COMPUTE_LOGGER)
+   protected Logger logger = Logger.NULL;
+
+   private final AzureComputeApi api;
+   private final LoadingCache<String, ResourceGroup> resourceGroupMap;
+
+   @Inject
+   TemplateToAvailabilitySet(AzureComputeApi api, LoadingCache<String, 
ResourceGroup> resourceGroupMap) {
+      this.api = api;

It can produce issues if it is used when the context is closed, for example 
when used as a transformation function in a lazy iterable that is executed 
later than expected. I don't think this is the case and I'm convinced it's not 
an issue (there are lots of jclouds functions there with the API injected). If 
it makes more sense, we can remove the `Function` interface so it is not usable 
in lazy iterations out of the box to prevent the mentioned issue , but as said, 
I don't think this is an issue at all. Could you be more specific about the 
issues you found?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/356

Reply via email to