org.jclouds.rest.config
Class BinderUtils
java.lang.Object
org.jclouds.rest.config.BinderUtils
public class BinderUtils
- extends Object
- Author:
- Adrian Cole
Method Summary |
static
|
bindAsyncClient(com.google.inject.Binder binder,
Class<T> asyncClientType)
|
static
|
bindClient(com.google.inject.Binder binder,
Class<K> syncClientType,
Class<V> asyncClientType,
Map<Class<?>,Class<?>> delegates)
|
static
|
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
|
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
|
newNullProxy(Class<T> clazz)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BinderUtils
public BinderUtils()
bindClientAndAsyncClient
public 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.
note
This client cannot have @Delegate methods, so if you have them, use the
overloaded method
.
- Type Parameters:
S
- sync client typeA
- async client type (all methods have same args as client, but return
listenablefuture)- Parameters:
binder
- guice bindersyncClientType
- interface for the sync clientasyncClientType
- interface for the async client
bindClientAndAsyncClient
public 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.
- Type Parameters:
S
- sync client typeA
- async client type (all methods have same args as client, but return
listenablefuture)- Parameters:
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 methods
bindClient
public static <K,V> void bindClient(com.google.inject.Binder binder,
Class<K> syncClientType,
Class<V> asyncClientType,
Map<Class<?>,Class<?>> delegates)
bindAsyncClient
public static <T> void bindAsyncClient(com.google.inject.Binder binder,
Class<T> asyncClientType)
newNullProxy
public static <T> T newNullProxy(Class<T> clazz)
Copyright © 2009-2012 jclouds. All Rights Reserved.