public class BinderUtils extends Object
Constructor and Description |
---|
BinderUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> void |
bindAsyncClient(com.google.inject.Binder binder,
Class<T> asyncClientType) |
static <K,V> void |
bindClient(com.google.inject.Binder binder,
Class<K> syncClientType,
Class<V> asyncClientType,
Map<Class<?>,Class<?>> sync2Async) |
static <S,A> void |
bindClientAndAsyncClient(com.google.inject.Binder binder,
Class<?> syncClientType,
Class<?> asyncClientType)
adds an explicit binding for a rest client, after which you can inject either the sync or
async client class.
|
static <S,A> void |
bindClientAndAsyncClient(com.google.inject.Binder binder,
Class<?> syncClientType,
Class<?> asyncClientType,
Map<Class<?>,Class<?>> sync2Async)
adds an explicit binding for a rest client, after which you can inject either the sync or
async client class.
|
static <T> T |
newNullProxy(Class<T> clazz) |
public static <S,A> void bindClientAndAsyncClient(com.google.inject.Binder binder, Class<?> syncClientType, Class<?> asyncClientType)
overloaded method
.S
- sync client typeA
- async client type (all methods have same args as client, but return
listenablefuture)binder
- guice bindersyncClientType
- interface for the sync clientasyncClientType
- interface for the async clientpublic static <S,A> void bindClientAndAsyncClient(com.google.inject.Binder binder, Class<?> syncClientType, Class<?> asyncClientType, Map<Class<?>,Class<?>> sync2Async)
S
- sync client typeA
- async client type (all methods have same args as client, but return
listenablefuture)binder
- guice bindersyncClientType
- interface for the sync client (ex. LoginClient)asyncClientType
- interface for the async client (ex. LoginAsyncClient)sync2Async
- presuming your clients are annotated with @Delegate, contains the sync to async
classes relating to these methodspublic static <K,V> void bindClient(com.google.inject.Binder binder, Class<K> syncClientType, Class<V> asyncClientType, Map<Class<?>,Class<?>> sync2Async)
public static <T> void bindAsyncClient(com.google.inject.Binder binder, Class<T> asyncClientType)
public static <T> T newNullProxy(Class<T> clazz)
Copyright © 2009-2013 jclouds. All Rights Reserved.