Package org.javalite.activeweb
Class Bootstrap
java.lang.Object
org.javalite.activeweb.Bootstrap
- All Implemented Interfaces:
InitConfig
This is an abstract class designed to be overridden in the application. The name for a subclass is:
app.config.AppBootstrap
. This class is called by the framework during initialization.- Author:
- Igor Polevoy
- See Also:
AbstractDBConfig
,AbstractControllerConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy(AppContext context)
Called when application is destroyed (un-deployed).com.google.inject.Injector
Subclasses need to override this method to return instance of Injector to use for dependency injection.abstract void
init(AppContext context)
Called when application bootstraps.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.javalite.activeweb.InitConfig
completeInit
-
Constructor Details
-
Bootstrap
public Bootstrap()
-
-
Method Details
-
init
Called when application bootstraps.- Specified by:
init
in interfaceInitConfig
- Parameters:
context
- app context instance
-
destroy
Called when application is destroyed (un-deployed). Override to catch event.- Parameters:
context
- app context instance
-
getInjector
public com.google.inject.Injector getInjector()Subclasses need to override this method to return instance of Injector to use for dependency injection.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.
- Returns:
- instance of Injector to use to inject dependencies into controllers, filters and tags.
-