public abstract class Bootstrap extends Object implements AppConfig
app.config.AppBootstrap
. This class is called by the framework during initialization.AbstractDBConfig
,
AbstractControllerConfig
Constructor and Description |
---|
Bootstrap() |
Modifier and Type | Method and Description |
---|---|
void |
destroy(AppContext context)
Called when application is destroyed (un-deployed).
|
com.google.inject.Injector |
getInjector()
Subclasses need to override this method to return instance of Injector to use for dependency injection.
|
abstract void |
init(AppContext context)
Called when application is bootstraps.
|
protected void |
registerTag(String name,
FreeMarkerTag tag)
Deprecated.
|
void |
setInjector(com.google.inject.Injector injector)
Deprecated.
This method will be removed in future versions. Instead, override
getInjector() method
to produce your injector. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
completeInit
@Deprecated protected void registerTag(String name, FreeMarkerTag tag)
public abstract void init(AppContext context)
public void destroy(AppContext context)
context
- app context instancepublic void setInjector(com.google.inject.Injector injector)
getInjector()
method
to produce your injector.This method has no effect during testing. Each test class will set its own injector with mocks for testing.
injector
- Injector instance to use for dependency injection.public com.google.inject.Injector getInjector()
This method is NOT USED during testing. Each test class will set its own injector with mocks for testing.
It is important to not create a new instance of injector each time this method is called, but rather than return the same instance.
No synchronization is needed because the first time this method is used, it is done in one thread.
Copyright © 2019. All rights reserved.