Issue 297: made ssh optional in case we are in gae and we cannot invoke network sockets

This commit is contained in:
Adrian Cole 2010-06-29 15:52:41 -07:00
parent 714a459796
commit 20f1a75606
2 changed files with 9 additions and 6 deletions

View File

@ -18,6 +18,8 @@
*/ */
package org.jclouds.compute; package org.jclouds.compute;
import javax.annotation.Nullable;
import org.jclouds.compute.internal.UtilsImpl; import org.jclouds.compute.internal.UtilsImpl;
import org.jclouds.ssh.SshClient; import org.jclouds.ssh.SshClient;
@ -29,7 +31,9 @@ import com.google.inject.ImplementedBy;
*/ */
@ImplementedBy(UtilsImpl.class) @ImplementedBy(UtilsImpl.class)
public interface Utils extends org.jclouds.rest.Utils { public interface Utils extends org.jclouds.rest.Utils {
@Nullable
SshClient.Factory getSshClientFactory(); SshClient.Factory getSshClientFactory();
@Nullable
SshClient.Factory sshFactory(); SshClient.Factory sshFactory();
} }

View File

@ -20,7 +20,6 @@ package org.jclouds.compute.internal;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.inject.Singleton; import javax.inject.Singleton;
@ -31,27 +30,27 @@ import org.jclouds.encryption.EncryptionService;
import org.jclouds.logging.Logger.LoggerFactory; import org.jclouds.logging.Logger.LoggerFactory;
import org.jclouds.rest.HttpAsyncClient; import org.jclouds.rest.HttpAsyncClient;
import org.jclouds.rest.HttpClient; import org.jclouds.rest.HttpClient;
import org.jclouds.ssh.SshClient;
import org.jclouds.ssh.SshClient.Factory; import org.jclouds.ssh.SshClient.Factory;
import com.google.inject.Inject;
/** /**
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@Singleton @Singleton
public class UtilsImpl extends org.jclouds.rest.internal.UtilsImpl implements Utils { public class UtilsImpl extends org.jclouds.rest.internal.UtilsImpl implements Utils {
@Inject(optional = true)
private final Factory sshFactory; private Factory sshFactory;
@Inject @Inject
UtilsImpl(HttpClient simpleClient, HttpAsyncClient simpleAsyncClient, UtilsImpl(HttpClient simpleClient, HttpAsyncClient simpleAsyncClient,
EncryptionService encryption, DateService date, EncryptionService encryption, DateService date,
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService userThreads, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService userThreads,
@Named(Constants.PROPERTY_IO_WORKER_THREADS) ExecutorService ioThreads, @Named(Constants.PROPERTY_IO_WORKER_THREADS) ExecutorService ioThreads,
LoggerFactory loggerFactory, SshClient.Factory sshFactory) { LoggerFactory loggerFactory) {
super(simpleClient, simpleAsyncClient, encryption, date, userThreads, ioThreads, super(simpleClient, simpleAsyncClient, encryption, date, userThreads, ioThreads,
loggerFactory); loggerFactory);
this.sshFactory = sshFactory;
} }
@Override @Override