-
Notifications
You must be signed in to change notification settings - Fork 179
Governator Phases
Randgalt edited this page Aug 24, 2012
·
15 revisions
Guice users are familiar with the “binding phase” where Guice calls your modules to register bindings. You then create the Injector as a second phase. Governator introduces several new phases. The timeline is like this:
- Classpath scanning phase
- Specified packages are scanned for Governator annotations
- The classes are stored for later phases
- Bootstrapping phase
- The Application bootstrap module (if specified) is invoked
- Auto bind ConfigurationProviders are bound
- The LifecycleManager is created via the bootstrap Injector
- Main Injector phase
- Application provided modules are added
- AutoBindSingletons are bound
- The main Injector is created
- As each object is created by Guice:
- PreConfiguration methods are called
- Configuration values are set
- PostConstruct methods are called
- Start phase
- The application calls LifecycleManager.start()
- Bean/field validation is done
- Any WarmUp methods are executed in background threads
When application calls LifecycleManager.close() …
Each object that is being actively managed is shutdown in these steps:
- CoolDown methods are executed in background threads
- PreDestroy methods are called
- Home
- Getting Started
- Bootstrapping
- Lifecycle Management
- Auto Binding
- Module-Dependencies
- Warm Up
- Configuration Mapping
- Field Validation
- Lazy Singleton
- Concurrent Singleton
- Generic Binding Annotations
- LifecycleListener
- Governator Phases
- Grapher Integration
- JUnit Testing
- FAQ
- Best Practices
- Spring, PicoContainer, Etc.
- Javadoc
- End-to-End Examples