public class ContainerBuilder extends Object
This is the inactive, mutable Container
. Because it requires references to the application internals, it
should always be injected by guice or created by calling ContainerActivator.newContainerBuilder()
. Once the
builder has been configured, it is activated by calling ContainerActivator.activateContainer(ContainerBuilder)
. You may use the setAppContext(Object)
method to
attach an arbitrary object to a Container, which will be available in the corresponding DeactivatedContainer
.
Modifier and Type | Field and Description |
---|---|
private Object |
appContext |
private Map<String,BindingRepository<RequestHandler>> |
clientBindings |
private GuiceRepository |
guiceModules |
private Map<String,BindingRepository<RequestHandler>> |
serverBindings |
private ServerRepository |
serverProviders |
Constructor and Description |
---|
ContainerBuilder(Iterable<com.google.inject.Module> guiceModules) |
Modifier and Type | Method and Description |
---|---|
Map<String,BindingSet<RequestHandler>> |
activateClientBindings() |
Map<String,BindingSet<RequestHandler>> |
activateServerBindings() |
Object |
appContext() |
BindingRepository<RequestHandler> |
clientBindings() |
BindingRepository<RequestHandler> |
clientBindings(String setName) |
<T> T |
getInstance(Class<T> type) |
<T> T |
getInstance(com.google.inject.Key<T> key) |
GuiceRepository |
guiceModules() |
static <T> Class<T> |
safeClassCast(Class<T> baseClass,
Class<?> someClass) |
static List<String> |
safeStringSplit(Object obj,
String delim) |
BindingRepository<RequestHandler> |
serverBindings() |
BindingRepository<RequestHandler> |
serverBindings(String setName) |
ServerRepository |
serverProviders() |
void |
setAppContext(Object ctx) |
private final GuiceRepository guiceModules
private final ServerRepository serverProviders
private final Map<String,BindingRepository<RequestHandler>> serverBindings
private final Map<String,BindingRepository<RequestHandler>> clientBindings
private Object appContext
public ContainerBuilder(Iterable<com.google.inject.Module> guiceModules)
public void setAppContext(Object ctx)
public Object appContext()
public GuiceRepository guiceModules()
public <T> T getInstance(com.google.inject.Key<T> key)
public <T> T getInstance(Class<T> type)
public ServerRepository serverProviders()
public BindingRepository<RequestHandler> serverBindings()
public BindingRepository<RequestHandler> serverBindings(String setName)
public Map<String,BindingSet<RequestHandler>> activateServerBindings()
public BindingRepository<RequestHandler> clientBindings()
public BindingRepository<RequestHandler> clientBindings(String setName)
public Map<String,BindingSet<RequestHandler>> activateClientBindings()
Copyright © 2018. All rights reserved.