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<?>> delegates) |
static <S,A> void |
bindClientAndAsyncClient(com.google.inject.Binder binder,
Class<S> syncClientType,
Class<A> 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<S> syncClientType,
Class<A> asyncClientType,
Map<Class<?>,Class<?>> delegates)
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<S> syncClientType, Class<A> 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<S> syncClientType, Class<A> asyncClientType, Map<Class<?>,Class<?>> delegates)
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)delegates
- 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<?>> delegates)
public static <T> void bindAsyncClient(com.google.inject.Binder binder, Class<T> asyncClientType)
public static <T> T newNullProxy(Class<T> clazz)
Copyright © 2009-2012 jclouds. All Rights Reserved.