Merge pull request #1535 from maginatics/remove-duplicate-utils-getters

Remove duplicate Utils getters
This commit is contained in:
Adrian Cole 2013-04-12 17:32:06 -07:00
commit d316549d64
12 changed files with 4 additions and 185 deletions

View File

@ -122,12 +122,6 @@ public interface BlobStoreContext extends Closeable, View {
@Deprecated
ConsistencyModel getConsistencyModel();
Utils getUtils();
/**
* @see #getUtils
*/
Utils utils();
/**

View File

@ -103,11 +103,6 @@ public class BlobStoreContextImpl extends BaseView implements BlobStoreContext {
return ablobStore;
}
@Override
public Utils getUtils() {
return utils();
}
@Override
public Utils utils() {
return utils;

View File

@ -37,11 +37,6 @@ public interface ComputeServiceContext extends Closeable, View {
ComputeService getComputeService();
Utils getUtils();
/**
* @see #getUtils
*/
Utils utils();
@Override

View File

@ -58,11 +58,6 @@ public class ComputeServiceContextImpl extends BaseView implements ComputeServic
delegate().close();
}
@Override
public Utils getUtils() {
return utils();
}
@Override
public Utils utils() {
return utils;

View File

@ -61,11 +61,6 @@ public interface Context extends Location, Closeable {
*/
String getIdentity();
Utils getUtils();
/**
* @see #getUtils
*/
Utils utils();
/**

View File

@ -98,14 +98,6 @@ public class ContextImpl implements Context {
return creds.get().identity;
}
/**
* {@inheritDoc}
*/
@Override
public Utils getUtils() {
return utils();
}
@Override
public Utils utils() {
return utils;

View File

@ -60,58 +60,22 @@ public interface Utils {
* </ul>
*/
@Beta
Map<String, Credentials> getCredentialStore();
/**
* @see ComputeServiceContext#getCredentialStore
*/
@Beta
Map<String, Credentials> credentialStore();
Json getJson();
/**
* #see #getJson
*/
Json json();
/**
*
* @deprecated will be removed in jclouds 1.7, as async interfaces are no
* longer supported.
* @see #getHttpClient()
*/
@Deprecated
HttpAsyncClient getHttpAsyncClient();
/**
*
* @deprecated will be removed in jclouds 1.7, as async interfaces are no
* longer supported.
* @see #http()
*/
@Deprecated
HttpAsyncClient asyncHttp();
HttpClient getHttpClient();
/**
* #see #getHttpClient
*/
HttpClient http();
Crypto getCrypto();
/**
* #see #getCrypto
*/
Crypto crypto();
DateService getDateService();
/**
* #see #getDateService
*/
DateService date();
/**
@ -119,15 +83,6 @@ public interface Utils {
* longer supported.
*/
@Deprecated
ListeningExecutorService getUserExecutor();
/**
* #see #getUserExecutor
*
* @deprecated will be removed in jclouds 1.7, as async interfaces are no
* longer supported.
*/
@Deprecated
ListeningExecutorService userExecutor();
/**
@ -135,44 +90,15 @@ public interface Utils {
* longer supported.
*/
@Deprecated
ListeningExecutorService getIoExecutor();
/**
* #see #getIoExecutor
*
* @deprecated will be removed in jclouds 1.7, as async interfaces are no
* longer supported.
*/
@Deprecated
ListeningExecutorService ioExecutor();
@Beta
EventBus getEventBus();
EventBus eventBus();
LoggerFactory getLoggerFactory();
/**
* #see #getLoggerFactory
*/
LoggerFactory loggerFactory();
@Beta
Injector getInjector();
/**
* #see #getInjector
*/
@Beta
Injector injector();
XMLParser getXml();
/**
* #see #getXml
*/
XMLParser xml();
}

View File

@ -93,42 +93,11 @@ public class UtilsImpl implements Utils {
return encryption;
}
@Override
public DateService getDateService() {
return date;
}
@Override
public Crypto getCrypto() {
return encryption;
}
@Override
@Deprecated
public org.jclouds.rest.HttpAsyncClient getHttpAsyncClient() {
return simpleAsyncClient;
}
@Override
public HttpClient getHttpClient() {
return simpleClient;
}
@Override
public HttpClient http() {
return simpleClient;
}
@Override
public ListeningExecutorService getIoExecutor() {
return ioExecutor;
}
@Override
public ListeningExecutorService getUserExecutor() {
return userExecutor;
}
@Override
public ListeningExecutorService ioExecutor() {
return ioExecutor;
@ -139,51 +108,25 @@ public class UtilsImpl implements Utils {
return userExecutor;
}
@Override
public EventBus getEventBus() {
return eventBus;
}
@Override
public EventBus eventBus() {
return eventBus;
}
@Override
public LoggerFactory getLoggerFactory() {
return loggerFactory;
}
@Override
public LoggerFactory loggerFactory() {
return loggerFactory;
}
@Override
public Json getJson() {
return json;
}
@Override
public Json json() {
return json;
}
@Override
@Beta
public Injector getInjector() {
return injector;
}
@Override
@Beta
public Injector injector() {
return getInjector();
}
@Override
public XMLParser getXml() {
return xml;
return injector;
}
@Override
@ -196,9 +139,4 @@ public class UtilsImpl implements Utils {
return credentialStore;
}
@Override
public Map<String, Credentials> getCredentialStore() {
return credentialStore;
}
}

View File

@ -22,7 +22,7 @@ public class GaeSocketOpenTest {
.modules(ImmutableSet.of(new GoogleAppEngineConfigurationModule()))
.build();
SocketOpen socketOpen = context.getUtils().getInjector().getInstance(SocketOpen.class);
SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
socketOpen.apply(HostAndPort.fromParts("localhost", 22));
}
}

View File

@ -38,12 +38,6 @@ public interface LoadBalancerServiceContext extends Closeable, View {
LoadBalancerService getLoadBalancerService();
Utils getUtils();
/**
* @see #getUtils
*/
Utils utils();
@Override

View File

@ -54,11 +54,6 @@ public class LoadBalancerServiceContextImpl extends BaseView implements LoadBala
return loadBalancerService;
}
@Override
public Utils getUtils() {
return utils();
}
@Override
public Utils utils() {
return utils;

View File

@ -48,11 +48,11 @@ public class AWSEC2ImageExtensionLiveTest extends BaseImageExtensionLiveTest {
@Override
protected Iterable<? extends Image> listImages() {
AWSEC2Client client = view.utils().getInjector().getInstance(AWSEC2Client.class);
AWSEC2Client client = view.utils().injector().getInstance(AWSEC2Client.class);
String[] parts = AWSUtils.parseHandle(imageId);
String region = parts[0];
String imageId = parts[1];
EC2ImageParser parser = view.utils().getInjector().getInstance(EC2ImageParser.class);
EC2ImageParser parser = view.utils().injector().getInstance(EC2ImageParser.class);
return transform(
client.getAMIServices().describeImagesInRegion(region, new DescribeImagesOptions().imageIds(imageId)),
parser);