public abstract class Bootstrap extends Object implements InitConfig
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
completeInit
public abstract void init(AppContext context)
init
in interface InitConfig
context
- app context instancepublic void destroy(AppContext context)
context
- app context instancepublic 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 JavaLite. All rights reserved.