diff --git a/compute/src/main/java/org/jclouds/compute/internal/UtilsImpl.java b/compute/src/main/java/org/jclouds/compute/internal/UtilsImpl.java index b38f320b6b..bc8b259581 100644 --- a/compute/src/main/java/org/jclouds/compute/internal/UtilsImpl.java +++ b/compute/src/main/java/org/jclouds/compute/internal/UtilsImpl.java @@ -23,6 +23,7 @@ import java.util.concurrent.ExecutorService; import javax.inject.Named; import javax.inject.Singleton; +import com.google.inject.Injector; import org.jclouds.Constants; import org.jclouds.compute.Utils; import org.jclouds.compute.domain.NodeMetadata; @@ -49,11 +50,11 @@ public class UtilsImpl extends org.jclouds.rest.internal.UtilsImpl implements Ut private final Function sshForNode; @Inject - UtilsImpl(Json json, HttpClient simpleClient, HttpAsyncClient simpleAsyncClient, Crypto encryption, + UtilsImpl(Injector injector, Json json, HttpClient simpleClient, HttpAsyncClient simpleAsyncClient, Crypto encryption, DateService date, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService userThreads, @Named(Constants.PROPERTY_IO_WORKER_THREADS) ExecutorService ioThreads, LoggerFactory loggerFactory, Function sshForNode) { - super(json, simpleClient, simpleAsyncClient, encryption, date, userThreads, ioThreads, loggerFactory); + super(injector, json, simpleClient, simpleAsyncClient, encryption, date, userThreads, ioThreads, loggerFactory); this.sshForNode = sshForNode; } @@ -71,5 +72,4 @@ public class UtilsImpl extends org.jclouds.rest.internal.UtilsImpl implements Ut public Function sshForNode() { return sshForNode; } - } diff --git a/core/src/main/java/org/jclouds/rest/Utils.java b/core/src/main/java/org/jclouds/rest/Utils.java index 136fef380c..e721277178 100644 --- a/core/src/main/java/org/jclouds/rest/Utils.java +++ b/core/src/main/java/org/jclouds/rest/Utils.java @@ -20,6 +20,8 @@ package org.jclouds.rest; import java.util.concurrent.ExecutorService; +import com.google.common.annotations.Beta; +import com.google.inject.Injector; import org.jclouds.crypto.Crypto; import org.jclouds.date.DateService; import org.jclouds.json.Json; @@ -92,4 +94,14 @@ public interface Utils { * #see #getLoggerFactory */ LoggerFactory loggerFactory(); + + + @Beta + Injector getInjector(); + + /** + * #see #getInjector + */ + @Beta + Injector injector(); } diff --git a/core/src/main/java/org/jclouds/rest/internal/UtilsImpl.java b/core/src/main/java/org/jclouds/rest/internal/UtilsImpl.java index b7e4a9fe5a..b7dfee9801 100644 --- a/core/src/main/java/org/jclouds/rest/internal/UtilsImpl.java +++ b/core/src/main/java/org/jclouds/rest/internal/UtilsImpl.java @@ -23,6 +23,8 @@ import java.util.concurrent.ExecutorService; import javax.inject.Inject; import javax.inject.Named; +import com.google.common.annotations.Beta; +import com.google.inject.Injector; import org.jclouds.Constants; import org.jclouds.crypto.Crypto; import org.jclouds.date.DateService; @@ -48,12 +50,14 @@ public class UtilsImpl implements Utils { private final ExecutorService userExecutor; private final ExecutorService ioExecutor; private final LoggerFactory loggerFactory; + private Injector injector; @Inject - protected UtilsImpl(Json json, HttpClient simpleClient, HttpAsyncClient simpleAsyncClient, + protected UtilsImpl(Injector injector, Json json, HttpClient simpleClient, HttpAsyncClient simpleAsyncClient, Crypto encryption, DateService date, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService userThreads, @Named(Constants.PROPERTY_IO_WORKER_THREADS) ExecutorService ioThreads, LoggerFactory loggerFactory) { + this.injector = injector; this.json = json; this.simpleClient = simpleClient; this.simpleAsyncClient = simpleAsyncClient; @@ -144,4 +148,16 @@ public class UtilsImpl implements Utils { return json; } + @Override + @Beta + public Injector getInjector() { + return injector; + } + + @Override + @Beta + public Injector injector() { + return getInjector(); + } + }