nacx commented on this pull request.


>        super(backend, backendType);
       this.consistencyModel = checkNotNull(consistencyModel, 
"consistencyModel");
       this.blobStore = checkNotNull(blobStore, "blobStore");
       this.utils = checkNotNull(utils, "utils");
       this.blobRequestSigner = checkNotNull(blobRequestSigner, 
"blobRequestSigner");
+      Binding<AsyncBlobStore> asyncBlobStoreBinding = 
injector.getExistingBinding(Key.get(AsyncBlobStore.class));
+      if (asyncBlobStoreBinding != null) {
+         asyncBlobStore = asyncBlobStoreBinding.getProvider().get();
+      } else {
+         asyncBlobStore = null;
+      }

Hmmm, I've just seen there is no base class for all BlobStore context modules 
(unlike in compute). A clean option would be to create that base module class 
and declare there the method that `@Provides` the `Optional<AsyncBlobStore>` 
based on the presence of that binding. The context modules for all blobstore 
providers should extend that class, and then you can just have the optional 
async blobstore injected. I'd like something like these, so provider code just 
can inject an `Optional<AsyncBlobStore>` without having to inspect the bindings.

-- 
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/pull/1114#discussion_r123458661

Reply via email to