ApiMetadata selectedApi = selectedCloud.getApi();
if (selectedProvider != null && selectedProvider != JClouds.EMPTY_PROVIDER) {
context = ContextBuilder.newBuilder(selectedProvider)
.credentials(selectedCloud.getIdentity(), selectedCloud.getCredential())
.overrides(overrides)
.modules(ImmutableSet.<Module> of(new Log4JLoggingModule(),
new SshjSshClientModule()))
.buildView(ComputeServiceContext.class);
} else if (selectedApi != null && selectedApi != JClouds.EMPTY_API) {
context = ContextBuilder.newBuilder(selectedApi)
.credentials(selectedCloud.getIdentity(), selectedCloud.getCredential())
.overrides(overrides)
.modules(ImmutableSet.<Module> of(new Log4JLoggingModule(),
new SshjSshClientModule()))
.buildView(ComputeServiceContext.class);
} else {
return new Image[0];
}