@ SuppressWarnings ( "unchecked" ) public static void configureModules ( final ConfigurationContext context ) { final Options options = new Options ( context . options ( ) ) ; for ( Module mod : context . getEnabledModules ( ) ) { if ( mod instanceof BootstrapAwareModule ) { ( ( BootstrapAwareModule ) mod ) . setBootstrap ( context . getBootstrap ( ) ) ; } if ( mod instanceof ConfigurationAwareModule ) { ( ( ConfigurationAwareModule ) mod ) . setConfiguration ( context . getConfiguration ( ) ) ; } if ( mod instanceof ConfigurationTreeAwareModule ) { ( ( ConfigurationTreeAwareModule ) mod ) . setConfigurationTree ( context . getConfigurationTree ( ) ) ; } if ( mod instanceof EnvironmentAwareModule ) { ( ( EnvironmentAwareModule ) mod ) . setEnvironment ( context . getEnvironment ( ) ) ; } if ( mod instanceof OptionsAwareModule ) { ( ( OptionsAwareModule ) mod ) . setOptions ( options ) ; } } }
Post - process registered modules by injecting bootstrap configuration environment and options objects .