org.jclouds.rest
Class RestContextBuilder<S,A>

java.lang.Object
  extended by org.jclouds.rest.RestContextBuilder<S,A>
Direct Known Subclasses:
AzureStorageContextBuilder, BlobStoreContextBuilder, CloudWatchContextBuilder, ComputeServiceContextBuilder, LoadBalancerServiceContextBuilder

public class RestContextBuilder<S,A>
extends Object

Creates RestContext or Injector instances based on the most commonly requested arguments.

Note that Threadsafe objects will be bound as singletons to the Injector or Context provided.

If no Modules are specified, the default logging and http transports will be installed.

Author:
Adrian Cole, Andrew Newdigate
See Also:
RestContext

Field Summary
protected  Class<A> asyncClientType
           
protected  List<com.google.inject.Module> modules
           
protected  Properties properties
           
protected  Class<S> syncClientType
           
 
Constructor Summary
RestContextBuilder(Class<S> syncClientClass, Class<A> asyncClientClass, Properties properties)
           
 
Method Summary
protected  void addClientModule(List<com.google.inject.Module> modules)
           
protected  void addClientModuleIfNotPresent(List<com.google.inject.Module> modules)
           
protected  void addContextModule(List<com.google.inject.Module> modules)
           
protected  void addContextModuleIfNotPresent(List<com.google.inject.Module> modules)
           
protected  void addCredentialStoreIfNotPresent(List<com.google.inject.Module> modules)
           
protected  void addExecutorServiceIfNotPresent(List<com.google.inject.Module> modules)
           
protected  void addHttpModuleIfNeededAndNotPresent(List<com.google.inject.Module> modules)
           
protected  void addLoggingModuleIfNotPresent(List<com.google.inject.Module> modules)
           
<T extends RestContext<S,A>>
T
buildContext()
           
 com.google.inject.Injector buildInjector()
           
 Properties getProperties()
           
protected  void ifHttpConfigureRestOtherwiseGuiceClientFactory(List<com.google.inject.Module> modules)
           
 RestContextBuilder<S,A> withModules(Iterable<com.google.inject.Module> modules)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected Properties properties

modules

protected List<com.google.inject.Module> modules

asyncClientType

protected Class<A> asyncClientType

syncClientType

protected Class<S> syncClientType
Constructor Detail

RestContextBuilder

@Inject
public RestContextBuilder(Class<S> syncClientClass,
                                 Class<A> asyncClientClass,
                                 Properties properties)
Method Detail

withModules

public RestContextBuilder<S,A> withModules(Iterable<com.google.inject.Module> modules)

buildInjector

public com.google.inject.Injector buildInjector()

addLoggingModuleIfNotPresent

protected void addLoggingModuleIfNotPresent(List<com.google.inject.Module> modules)

addHttpModuleIfNeededAndNotPresent

protected void addHttpModuleIfNeededAndNotPresent(List<com.google.inject.Module> modules)

addContextModuleIfNotPresent

protected void addContextModuleIfNotPresent(List<com.google.inject.Module> modules)

addContextModule

protected void addContextModule(List<com.google.inject.Module> modules)

ifHttpConfigureRestOtherwiseGuiceClientFactory

protected void ifHttpConfigureRestOtherwiseGuiceClientFactory(List<com.google.inject.Module> modules)

addClientModuleIfNotPresent

protected void addClientModuleIfNotPresent(List<com.google.inject.Module> modules)

addClientModule

protected void addClientModule(List<com.google.inject.Module> modules)

addExecutorServiceIfNotPresent

protected void addExecutorServiceIfNotPresent(List<com.google.inject.Module> modules)

addCredentialStoreIfNotPresent

protected void addCredentialStoreIfNotPresent(List<com.google.inject.Module> modules)

getProperties

public Properties getProperties()

buildContext

public <T extends RestContext<S,A>> T buildContext()


Copyright © 2009-2011 jclouds. All Rights Reserved.