org.jclouds.rest.config
Class BinderUtils

java.lang.Object
  extended by org.jclouds.rest.config.BinderUtils

public class BinderUtils
extends Object

Author:
Adrian Cole

Constructor Summary
BinderUtils()
           
 
Method Summary
static
<S,A> void
bindBlockingApi(com.google.inject.Binder binder, Class<S> sync, Class<A> async)
          adds an explicit binding for an interface which synchronously blocks on similar calls to an async type.
static
<S,A> void
bindHttpApi(com.google.inject.Binder binder, Class<S> sync, Class<A> async)
          adds an explicit binding for async by parsing its annotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinderUtils

public BinderUtils()
Method Detail

bindHttpApi

public static <S,A> void bindHttpApi(com.google.inject.Binder binder,
                                     Class<S> sync,
                                     Class<A> async)
adds an explicit binding for async by parsing its annotations. Then. adds an explicit binding for an interface which synchronously blocks on similar calls to an async type.

Type Parameters:
S - sync interface that blocks
A - async type where all methods have same args as sync, but returns ListenableFuture
Parameters:
binder - guice binder
sync - type interface that blocks
async - type type that returns ListenableFuture

bindBlockingApi

public static <S,A> void bindBlockingApi(com.google.inject.Binder binder,
                                         Class<S> sync,
                                         Class<A> async)
adds an explicit binding for an interface which synchronously blocks on similar calls to an async type.

Type Parameters:
S - sync interface that blocks
A - async type where all methods have same args as sync, but returns ListenableFuture
Parameters:
binder - guice binder
sync - type interface that blocks
async - type type that returns ListenableFuture


Copyright © 2009-2013 jclouds. All Rights Reserved.