public class RestContextBuilder<S,A> extends Object
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 Module
s are specified, the default logging
and
http transports
will be installed.RestContext
Modifier and Type | Field and Description |
---|---|
protected Class<A> |
asyncClientType |
protected List<com.google.inject.Module> |
modules |
protected Properties |
properties |
protected Class<S> |
syncClientType |
Constructor and Description |
---|
RestContextBuilder(Class<S> syncClientClass,
Class<A> asyncClientClass,
Properties properties) |
Modifier and Type | Method and Description |
---|---|
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>> |
buildContext() |
com.google.inject.Injector |
buildInjector() |
protected Properties |
getProperties() |
protected void |
ifHttpConfigureRestOtherwiseGuiceClientFactory(List<com.google.inject.Module> modules) |
RestContextBuilder<S,A> |
withModules(Iterable<com.google.inject.Module> modules) |
protected Properties properties
protected List<com.google.inject.Module> modules
public RestContextBuilder<S,A> withModules(Iterable<com.google.inject.Module> modules)
public com.google.inject.Injector buildInjector()
protected void addLoggingModuleIfNotPresent(List<com.google.inject.Module> modules)
protected void addHttpModuleIfNeededAndNotPresent(List<com.google.inject.Module> modules)
protected void addContextModuleIfNotPresent(List<com.google.inject.Module> modules)
protected void addContextModule(List<com.google.inject.Module> modules)
protected void ifHttpConfigureRestOtherwiseGuiceClientFactory(List<com.google.inject.Module> modules)
protected void addClientModuleIfNotPresent(List<com.google.inject.Module> modules)
protected void addClientModule(List<com.google.inject.Module> modules)
protected void addExecutorServiceIfNotPresent(List<com.google.inject.Module> modules)
protected void addCredentialStoreIfNotPresent(List<com.google.inject.Module> modules)
protected Properties getProperties()
public <T extends RestContext<S,A>> T buildContext()
Copyright © 2009-2012 jclouds. All Rights Reserved.