diff --git a/compute/src/main/java/org/jclouds/compute/Utils.java b/compute/src/main/java/org/jclouds/compute/Utils.java index 7477e4f167..e1f27d3de2 100644 --- a/compute/src/main/java/org/jclouds/compute/Utils.java +++ b/compute/src/main/java/org/jclouds/compute/Utils.java @@ -18,6 +18,8 @@ */ package org.jclouds.compute; +import javax.annotation.Nullable; + import org.jclouds.compute.internal.UtilsImpl; import org.jclouds.ssh.SshClient; @@ -29,7 +31,9 @@ import com.google.inject.ImplementedBy; */ @ImplementedBy(UtilsImpl.class) public interface Utils extends org.jclouds.rest.Utils { + @Nullable SshClient.Factory getSshClientFactory(); + @Nullable SshClient.Factory sshFactory(); } 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 1621ace75d..3739d6b737 100644 --- a/compute/src/main/java/org/jclouds/compute/internal/UtilsImpl.java +++ b/compute/src/main/java/org/jclouds/compute/internal/UtilsImpl.java @@ -20,7 +20,6 @@ package org.jclouds.compute.internal; import java.util.concurrent.ExecutorService; -import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; @@ -31,27 +30,27 @@ import org.jclouds.encryption.EncryptionService; import org.jclouds.logging.Logger.LoggerFactory; import org.jclouds.rest.HttpAsyncClient; import org.jclouds.rest.HttpClient; -import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshClient.Factory; +import com.google.inject.Inject; + /** * * @author Adrian Cole */ @Singleton public class UtilsImpl extends org.jclouds.rest.internal.UtilsImpl implements Utils { - - private final Factory sshFactory; + @Inject(optional = true) + private Factory sshFactory; @Inject UtilsImpl(HttpClient simpleClient, HttpAsyncClient simpleAsyncClient, EncryptionService encryption, DateService date, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService userThreads, @Named(Constants.PROPERTY_IO_WORKER_THREADS) ExecutorService ioThreads, - LoggerFactory loggerFactory, SshClient.Factory sshFactory) { + LoggerFactory loggerFactory) { super(simpleClient, simpleAsyncClient, encryption, date, userThreads, ioThreads, loggerFactory); - this.sshFactory = sshFactory; } @Override